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:
parent
8ad2b95208
commit
f56711f443
1 changed files with 12 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue