(546717195) Use the AIObjectiveFightIntruders.IsValidTarget for deciding whether or not the button should flash.

This commit is contained in:
Joonas Rikkonen
2019-05-16 06:55:43 +03:00
parent 5435adc9b4
commit f38aa90847
20 changed files with 200 additions and 243 deletions
@@ -18,10 +18,26 @@ namespace Barotrauma
private Character character;
private float _waitTimer;
/// <summary>
/// When set above zero, the character will stand still doing nothing until the timer runs out. Does not affect orders.
/// When set above zero, the character will stand still doing nothing until the timer runs out. Does not affect orders, find safety or combat.
/// </summary>
public float WaitTimer;
public float WaitTimer
{
get { return _waitTimer; }
set
{
if (CurrentObjective is AIObjectiveCombat || CurrentObjective is AIObjectiveFindSafety)
{
_waitTimer = 0;
}
else
{
_waitTimer = value;
}
}
}
public AIObjective CurrentOrder { get; private set; }
public AIObjective CurrentObjective { get; private set; }
@@ -197,6 +213,7 @@ namespace Barotrauma
}
else
{
// Wait, if not swimming, climbing, or staying in a forbidden/unsafe hull.
if (character.AIController is HumanAIController humanAI && humanAI.SteeringManager != null)
{
if (!character.AnimController.InWater &&