Minor Aircraft ResolveOrder optimization

Streamline RTB if checks.
This commit is contained in:
reaperrr
2020-02-20 03:04:16 +01:00
committed by Paul Chote
parent 805a8fc556
commit 1e43a8f590

View File

@@ -1070,10 +1070,10 @@ namespace OpenRA.Mods.Common.Traits
self.CancelActivity();
UnReserve();
}
else if (orderString == "ReturnToBase" && rearmable != null && rearmable.Info.RearmActors.Any())
else if (orderString == "ReturnToBase")
{
// Don't restart activity every time deploy hotkey is triggered
if (self.CurrentActivity is ReturnToBase || GetActorBelow() != null)
// Do nothing if not rearmable and don't restart activity every time deploy hotkey is triggered
if (rearmable == null || !rearmable.Info.RearmActors.Any() || self.CurrentActivity is ReturnToBase || GetActorBelow() != null)
return;
if (!order.Queued)