mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-30 00:28:08 -04:00
Issue #68: Remove dead actors from actor list
This commit is contained in:
parent
f2e25b8a47
commit
0547f11564
@ -199,13 +199,23 @@ namespace MWMechanics
|
|||||||
{
|
{
|
||||||
float totalDuration = mDuration;
|
float totalDuration = mDuration;
|
||||||
mDuration = 0;
|
mDuration = 0;
|
||||||
|
|
||||||
|
std::set<MWWorld::Ptr>::iterator iter (mActors.begin());
|
||||||
|
|
||||||
for (std::set<MWWorld::Ptr>::iterator iter (mActors.begin()); iter!=mActors.end(); ++iter)
|
while (iter!=mActors.end())
|
||||||
{
|
{
|
||||||
updateActor (*iter, totalDuration);
|
if (!MWWorld::Class::get (*iter).getCreatureStats (*iter).isDead())
|
||||||
|
{
|
||||||
|
updateActor (*iter, totalDuration);
|
||||||
|
|
||||||
if (iter->getTypeName()==typeid (ESM::NPC).name())
|
if (iter->getTypeName()==typeid (ESM::NPC).name())
|
||||||
updateNpc (*iter, totalDuration, paused);
|
updateNpc (*iter, totalDuration, paused);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MWWorld::Class::get (*iter).getCreatureStats (*iter).isDead())
|
||||||
|
mActors.erase (iter++);
|
||||||
|
else
|
||||||
|
++iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user