Fix inconsistent ordering

This commit is contained in:
Gustas
2023-09-05 18:06:39 +03:00
committed by Matthias Mailänder
parent 5b0f69b411
commit 161f4cbdff

View File

@@ -164,7 +164,7 @@ namespace OpenRA.Mods.Common.Traits
if (captee.IsDead)
return null;
foreach (var c in enabledCaptures.OrderBy(c => c.Info.SabotageThreshold))
foreach (var c in enabledCaptures.OrderBy(c => c.Info.SabotageThreshold).ThenBy(c => c.Info.CaptureDelay))
if (capteeManager.CanBeTargetedBy(captee, self, c))
return c;
@@ -209,10 +209,7 @@ namespace OpenRA.Mods.Common.Traits
if (targetManager.beingCapturedToken == Actor.InvalidConditionToken)
targetManager.beingCapturedToken = target.GrantCondition(targetManager.info.BeingCapturedCondition);
captures = enabledCaptures
.OrderBy(c => c.Info.CaptureDelay)
.FirstOrDefault(c => targetManager.CanBeTargetedBy(target, self, c));
captures = ValidCapturesWithLowestSabotageThreshold(self, target, targetManager);
if (captures == null)
return false;