1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-25 09:02:37 +00:00

Fix freeze in getActorsSidingWith

This commit is contained in:
Capostrophic 2018-08-21 16:47:29 +03:00
parent b748bb11ae
commit b77d733c3e

View File

@ -1790,14 +1790,13 @@ namespace MWMechanics
// Actors that are targeted by this actor's Follow or Escort packages also side with them // Actors that are targeted by this actor's Follow or Escort packages also side with them
for (auto package = stats.getAiSequence().begin(); package != stats.getAiSequence().end(); ++package) for (auto package = stats.getAiSequence().begin(); package != stats.getAiSequence().end(); ++package)
{ {
const MWWorld::Ptr &target = (*package)->getTarget(); if ((*package)->sideWithTarget() && !(*package)->getTarget().isEmpty())
if ((*package)->sideWithTarget() && !target.isEmpty())
{ {
if (iteratedActor == actor) if (iteratedActor == actor)
{ {
list.push_back(target); list.push_back((*package)->getTarget());
} }
else if (target == actor) else if ((*package)->getTarget() == actor)
{ {
list.push_back(iteratedActor); list.push_back(iteratedActor);
} }