(49f837fbb) Fix: operate battery or pump should not be looping objectives.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:17:24 +03:00
parent c8160f6e0b
commit c9bfc21880
10 changed files with 132 additions and 218 deletions
@@ -48,6 +48,6 @@ namespace Barotrauma
}
protected override AIObjective ObjectiveConstructor(PowerContainer battery)
=> new AIObjectiveOperateItem(battery, character, objectiveManager, Option, false, priorityModifier: PriorityModifier) { IsLoop = true };
=> new AIObjectiveOperateItem(battery, character, objectiveManager, Option, false, priorityModifier: PriorityModifier) { IsLoop = false };
}
}
@@ -42,7 +42,6 @@ namespace Barotrauma
}
return true;
}
protected override AIObjective ObjectiveConstructor(Pump pump) => new AIObjectiveOperateItem(pump, character, objectiveManager, Option, false) { IsLoop = true };
protected override float TargetEvaluation() => targets.Max(t => MathHelper.Lerp(100, 0, t.CurrFlow / t.MaxFlow));
protected override IEnumerable<Pump> GetList()
{
@@ -52,5 +51,7 @@ namespace Barotrauma
}
return pumpList;
}
protected override AIObjective ObjectiveConstructor(Pump pump) => new AIObjectiveOperateItem(pump, character, objectiveManager, Option, false) { IsLoop = false };
}
}