(4d2ab0cd2) Reset the find safety priority when a safe hull has been reached or when there is no danger to flee from. Use wandering instead of resetting the steering (unfortunately doesn't work in very small hulls like airlocks).

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:30:30 +03:00
parent 2945d103f9
commit 7155525d5b
2 changed files with 60 additions and 75 deletions
@@ -134,7 +134,15 @@ namespace Barotrauma
goToObjective = null;
}
}
if (goToObjective != null) { return; }
if (goToObjective != null)
{
if (goToObjective.IsCompleted())
{
objectiveManager.GetObjective<AIObjectiveIdle>()?.Wander(deltaTime);
}
Priority = 0;
return;
}
if (currentHull == null) { return; }
//goto objective doesn't exist (a safe hull not found, or a path to a safe hull not found)
// -> attempt to manually steer away from hazards
@@ -173,7 +181,8 @@ namespace Barotrauma
}
else
{
character.AIController.SteeringManager.Reset();
Priority = 0;
objectiveManager.GetObjective<AIObjectiveIdle>()?.Wander(deltaTime);
}
}
}