(2f379083c) Change how some of the priorities are clamped.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:06:30 +03:00
parent b5db30ec72
commit b7272e1c96
18 changed files with 165 additions and 42 deletions
@@ -48,7 +48,7 @@ namespace Barotrauma
float leakSize = (leak.IsHorizontal ? leak.Rect.Height : leak.Rect.Width) * Math.Max(leak.Open, 0.1f);
float dist = Vector2.DistanceSquared(character.SimPosition, leak.SimPosition);
dist = Math.Max(dist / 100.0f, 1.0f);
return MathHelper.Clamp(Priority + leakSize / dist, 0, 100);
return MathHelper.Clamp(Priority + leakSize / dist, 0, MathHelper.Min(AIObjectiveManager.OrderPriority + 20, 100));
}
public override bool IsDuplicate(AIObjective otherObjective)