mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +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
@ -519,13 +519,12 @@ namespace MWPhysics
|
||||
mObjects.emplace(updated, std::move(obj));
|
||||
}
|
||||
|
||||
ActorMap::iterator foundActor = mActors.find(old);
|
||||
if (foundActor != mActors.end())
|
||||
auto actorNode = mActors.extract(old);
|
||||
if (!actorNode.empty())
|
||||
{
|
||||
auto actor = foundActor->second;
|
||||
actor->updatePtr(updated);
|
||||
mActors.erase(foundActor);
|
||||
mActors.emplace(updated, std::move(actor));
|
||||
actorNode.key() = updated;
|
||||
actorNode.mapped()->updatePtr(updated);
|
||||
mActors.insert(std::move(actorNode));
|
||||
}
|
||||
|
||||
for (auto& [_, actor] : mActors)
|
||||
|
Loading…
Reference in New Issue
Block a user