From 921e4ef818197f40b765644b1849e5f1e32bc926 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 15 Apr 2019 12:05:20 +0300 Subject: [PATCH] (aff19d6cd) Don't reset the hull timer if cannot complete the divinggearobjective, because it might cause performance issues. Reduce the timer instead so that new hull is searched once per sec at max. --- .../Source/Characters/AI/Objectives/AIObjectiveFindSafety.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveFindSafety.cs b/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveFindSafety.cs index ae793f08f..6b735f0f5 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveFindSafety.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/AI/Objectives/AIObjectiveFindSafety.cs @@ -60,8 +60,8 @@ namespace Barotrauma else { divingGearObjective = null; - // Reset the timer so that we get a safe hull target. - searchHullTimer = 0; + // Reduce the timer so that we get a safe hull target faster. + searchHullTimer = Math.Min(1, searchHullTimer); } }