(220a59c65) Fixed nullref exception in AIObjectiveRescure.Act if the character has no FindSafety objective

This commit is contained in:
Joonas Rikkonen
2019-05-20 20:31:01 +03:00
parent 97b095bd10
commit b8da5670c1
23 changed files with 35 additions and 53 deletions
@@ -90,7 +90,8 @@ namespace Barotrauma
if (findSafety == null)
{
// Ensure that we have the find safety objective (should always be the case)
objectiveManager.AddObjective(new AIObjectiveFindSafety(character, objectiveManager));
findSafety = new AIObjectiveFindSafety(character, objectiveManager);
objectiveManager.AddObjective(findSafety);
}
safeHull = findSafety.FindBestHull(HumanAIController.VisibleHulls);
}