(e7b2add9d) Merge branch 'human-ai' of https://github.com/Regalis11/Barotrauma-development into human-ai

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:30:39 +03:00
parent 54a0164f89
commit 7614642d93
34 changed files with 369 additions and 316 deletions
@@ -115,17 +115,20 @@ namespace Barotrauma
public virtual void Update(float deltaTime)
{
var subObjective = objectiveManager.CurrentObjective?.CurrentSubObjective;
if (objectiveManager.CurrentOrder == this)
{
Priority = AIObjectiveManager.OrderPriority;
}
else if (objectiveManager.CurrentObjective == this || subObjective == this)
else if (objectiveManager.WaitTimer <= 0)
{
Priority += Devotion * PriorityModifier * deltaTime;
var subObjective = objectiveManager.CurrentObjective?.CurrentSubObjective;
if ((objectiveManager.CurrentObjective == this || subObjective == this))
{
Priority += Devotion * PriorityModifier * deltaTime;
}
Priority = MathHelper.Clamp(Priority, 0, 100);
subObjectives.ForEach(so => so.Update(deltaTime));
}
Priority = MathHelper.Clamp(Priority, 0, 100);
subObjectives.ForEach(so => so.Update(deltaTime));
}
/// <summary>