(02bbfb6a3) Let the ai objectives handle waiting (after switching characters). Currently only idle objective uses wait timer, others ignore it. Reduce the wait time from 20 to 10 secs.

This commit is contained in:
Joonas Rikkonen
2019-04-08 15:59:36 +03:00
parent eaf8b1275d
commit 28f2c00255
3 changed files with 33 additions and 12 deletions
@@ -54,10 +54,17 @@ namespace Barotrauma
character.SelectedConstruction = null;
}
bool currentHullForbidden = IsForbidden(character.CurrentHull);
if (!currentHullForbidden && !character.AnimController.InWater && !character.IsClimbing && HumanAIController.ObjectiveManager.WaitTimer > 0)
{
SteeringManager.Reset();
return;
}
bool currentTargetIsInvalid = currentTarget == null || IsForbidden(currentTarget) ||
(PathSteering.CurrentPath != null && PathSteering.CurrentPath.Nodes.Any(n => HumanAIController.UnsafeHulls.Contains(n.CurrentHull)));
if (currentTargetIsInvalid || (currentTarget == null && IsForbidden(character.CurrentHull)))
if (currentTargetIsInvalid || (currentTarget == null && currentHullForbidden))
{
newTargetTimer = 0;
standStillTimer = 0;