1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 22:15:32 +00:00

Fix crash caused by teleportation spells (Fixes #1904)

This commit is contained in:
scrawl 2014-09-25 18:00:32 +02:00
parent 8ad2b95208
commit f56711f443

View file

@ -1175,14 +1175,26 @@ namespace MWMechanics
iter->second->updateContinuousVfx();
// Animation/movement update
CharacterController* playerCharacter = NULL;
for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
{
if (iter->first.getClass().getCreatureStats(iter->first).getMagicEffects().get(
ESM::MagicEffect::Paralyze).getMagnitude() > 0)
iter->second->skipAnim();
// Handle player last, in case a cell transition occurs by casting a teleportation spell
// (would invalidate the iterator)
if (iter->first.getCellRef().getRefId() == "player")
{
playerCharacter = iter->second;
continue;
}
iter->second->update(duration);
}
if (playerCharacter)
playerCharacter->update(duration);
for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
{
const MWWorld::Class &cls = iter->first.getClass();