From da4ed24064f8ca80f68e25b050ba28ef3a5a3d53 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Thu, 20 Feb 2020 03:23:05 +0100 Subject: [PATCH] Mobile ResolveOrder optimization When the order is "Move", the other two 'if' checks are redundant, so 'else if' makes more sense here. --- OpenRA.Mods.Common/Traits/Mobile.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index 88aa5fbb99..33ceaea7f0 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -952,10 +952,9 @@ namespace OpenRA.Mods.Common.Traits } // TODO: This should only cancel activities queued by this trait - if (order.OrderString == "Stop") + else if (order.OrderString == "Stop") self.CancelActivity(); - - if (order.OrderString == "Scatter") + else if (order.OrderString == "Scatter") Nudge(self); }