forked from mirror/openmw-tes3mp
Issue #68: Remove dead actors from actor list
This commit is contained in:
parent
f2e25b8a47
commit
0547f11564
1 changed files with 14 additions and 4 deletions
|
@ -200,12 +200,22 @@ namespace MWMechanics
|
||||||
float totalDuration = mDuration;
|
float totalDuration = mDuration;
|
||||||
mDuration = 0;
|
mDuration = 0;
|
||||||
|
|
||||||
for (std::set<MWWorld::Ptr>::iterator iter (mActors.begin()); iter!=mActors.end(); ++iter)
|
std::set<MWWorld::Ptr>::iterator iter (mActors.begin());
|
||||||
{
|
|
||||||
updateActor (*iter, totalDuration);
|
|
||||||
|
|
||||||
if (iter->getTypeName()==typeid (ESM::NPC).name())
|
while (iter!=mActors.end())
|
||||||
updateNpc (*iter, totalDuration, paused);
|
{
|
||||||
|
if (!MWWorld::Class::get (*iter).getCreatureStats (*iter).isDead())
|
||||||
|
{
|
||||||
|
updateActor (*iter, totalDuration);
|
||||||
|
|
||||||
|
if (iter->getTypeName()==typeid (ESM::NPC).name())
|
||||||
|
updateNpc (*iter, totalDuration, paused);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MWWorld::Class::get (*iter).getCreatureStats (*iter).isDead())
|
||||||
|
mActors.erase (iter++);
|
||||||
|
else
|
||||||
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue