mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 08:53:52 +00:00
Merge branch 'donoteraseme' into 'master'
#6192: Stop crashing in moveActors() See merge request OpenMW/openmw!1085
This commit is contained in:
commit
bd1bf4ec73
1 changed files with 5 additions and 6 deletions
|
@ -519,13 +519,12 @@ namespace MWPhysics
|
||||||
mObjects.emplace(updated, std::move(obj));
|
mObjects.emplace(updated, std::move(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
ActorMap::iterator foundActor = mActors.find(old);
|
auto actorNode = mActors.extract(old);
|
||||||
if (foundActor != mActors.end())
|
if (!actorNode.empty())
|
||||||
{
|
{
|
||||||
auto actor = foundActor->second;
|
actorNode.key() = updated;
|
||||||
actor->updatePtr(updated);
|
actorNode.mapped()->updatePtr(updated);
|
||||||
mActors.erase(foundActor);
|
mActors.insert(std::move(actorNode));
|
||||||
mActors.emplace(updated, std::move(actor));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& [_, actor] : mActors)
|
for (auto& [_, actor] : mActors)
|
||||||
|
|
Loading…
Reference in a new issue