From cc0e217e82557a80b09a971c70b7a55f387937e3 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 15 Apr 2019 12:01:32 +0300 Subject: [PATCH] (e1476e522) Cleanup. --- .../Source/Characters/AI/Objectives/AIObjectiveIdle.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveIdle.cs b/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveIdle.cs index 865f18203..387c0edc3 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveIdle.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveIdle.cs @@ -26,6 +26,9 @@ namespace Barotrauma private float standStillTimer; private float walkDuration; + private readonly List targetHulls = new List(20); + private readonly List hullWeights = new List(20); + public AIObjectiveIdle(Character character) : base(character, "") { standStillTimer = Rand.Range(-10.0f, 10.0f); @@ -106,7 +109,7 @@ namespace Barotrauma if (isCurrentHullOK) { // Check that there is no unsafe or forbidden hulls on the way to the target - // Only do this when the current hull is ok, because otherwise the would block all paths from the current hull to the target hull. + // Only do this when the current hull is ok, because otherwise would block all paths from the current hull to the target hull. var path = PathSteering.PathFinder.FindPath(character.SimPosition, randomHull.SimPosition); if (path.Unreachable || path.Nodes.Any(n => HumanAIController.UnsafeHulls.Contains(n.CurrentHull) || IsForbidden(n.CurrentHull))) @@ -230,13 +233,9 @@ namespace Barotrauma } } - private readonly List targetHulls = new List(20); - private readonly List hullWeights = new List(20); - private void FindTargetHulls() { bool isCurrentHullOK = !HumanAIController.UnsafeHulls.Contains(character.CurrentHull) && !IsForbidden(character.CurrentHull); - targetHulls.Clear(); hullWeights.Clear(); foreach (var hull in Hull.hullList) @@ -266,7 +265,6 @@ namespace Barotrauma hullWeights.Add(weight); } } - } private bool IsForbidden(Hull hull)