From 5543c84586fa166d5a527ee36cea6f04b7c28e19 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 14 Aug 2010 21:58:54 +0200 Subject: [PATCH] bug-fixes: actors were registered twice at cell change; disabled references were rendered at cell change --- apps/openmw/mwrender/cellimp.cpp | 3 ++- apps/openmw/mwworld/world.cpp | 22 ---------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/apps/openmw/mwrender/cellimp.cpp b/apps/openmw/mwrender/cellimp.cpp index d1e1ec8f9..a5b4b51c7 100644 --- a/apps/openmw/mwrender/cellimp.cpp +++ b/apps/openmw/mwrender/cellimp.cpp @@ -19,9 +19,10 @@ void insertCellRefList (CellRenderImp& cellRender, MWWorld::Environment& environ for (typename T::List::iterator it = cellRefList.list.begin(); it != cellRefList.list.end(); it++) { - if (it->mData.getCount()) + if (it->mData.getCount() || it->mData.isEnabled()) { MWWorld::Ptr ptr (&*it, &cell); + class_.insertObj (ptr, cellRender, environment); class_.enable (ptr, environment); } diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index de69d7144..4ef20c7ff 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -562,28 +562,6 @@ namespace MWWorld mEnvironment.mMechanicsManager->addActor (mPlayerPos->getPlayer()); mEnvironment.mMechanicsManager->watchActor (mPlayerPos->getPlayer()); - for (ESMS::CellRefList::List::iterator iter ( - cell->creatures.list.begin()); - iter!=cell->creatures.list.end(); ++iter) - { - if (iter->mData.isEnabled()) - { - Ptr ptr (&*iter, cell); - mEnvironment.mMechanicsManager->addActor (ptr); - } - } - - for (ESMS::CellRefList::List::iterator iter ( - cell->npcs.list.begin()); - iter!=cell->npcs.list.end(); ++iter) - { - if (iter->mData.isEnabled()) - { - Ptr ptr (&*iter, cell); - mEnvironment.mMechanicsManager->addActor (ptr); - } - } - // Sky system if (mSky) {