(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
@@ -18,7 +18,7 @@ namespace Barotrauma
private Character character;
/// <summary>
/// When set above zero, the character will stand still doing nothing until the timer runs out (assuming they don't a high priority order active)
/// When set above zero, the character will stand still doing nothing until the timer runs out. Only affects idling.
/// </summary>
public float WaitTimer;
@@ -134,12 +134,7 @@ namespace Barotrauma
public void DoCurrentObjective(float deltaTime)
{
if (CurrentObjective == null || (CurrentObjective.GetPriority(this) < OrderPriority && WaitTimer > 0.0f))
{
WaitTimer -= deltaTime;
character.AIController.SteeringManager.Reset();
return;
}
if (WaitTimer > 0.0f) { WaitTimer -= deltaTime; }
CurrentObjective?.TryComplete(deltaTime);
}