(900eddc26) Take the priority modifier in account when calculating the priority, not the max value.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:13:03 +03:00
parent 3c8707fc16
commit ab2ca90d08
15 changed files with 123 additions and 94 deletions
@@ -39,10 +39,9 @@ namespace Barotrauma
public override float GetPriority(AIObjectiveManager objectiveManager)
{
if (leak.Open == 0.0f) { return 0.0f; }
float priority = AIObjectiveFixLeaks.GetLeakSeverity(leak);
float maxMultiplier = MathHelper.Min(PriorityModifier, 1);
float max = MathHelper.Min((AIObjectiveManager.OrderPriority - 1) * maxMultiplier, 90);
return MathHelper.Clamp(Priority + priority, 0, max);
float severity = AIObjectiveFixLeaks.GetLeakSeverity(leak);
float max = MathHelper.Min((AIObjectiveManager.OrderPriority - 1), 90);
return MathHelper.Clamp(Priority + severity * PriorityModifier, 0, max);
}
public override bool IsDuplicate(AIObjective otherObjective)