From 3ec4ee6290801d6e95381f72fe1428c32a5b927d Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 13 Jun 2016 02:06:44 +0200 Subject: [PATCH] Make a copy of map key to work around it being invalidated (Fixes #3329) --- apps/openmw/mwmechanics/actors.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index f627e62ae..a1031f4c8 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -997,7 +997,8 @@ namespace MWMechanics if (!iter->first.getClass().getCreatureStats(iter->first).isDead()) { - updateActor(iter->first, duration); + MWWorld::Ptr actor = iter->first; // make a copy of the map key to avoid it being invalidated when the player teleports + updateActor(actor, duration); if (MWBase::Environment::get().getWorld()->hasCellChanged()) { return; // for now abort update of the old cell when cell changes by teleportation magic effect