Remove Resupply re-queueing hack from Aircraft

By preventing that other traits can remotely cancel Resupply
or ReturnToBase.
This commit is contained in:
reaperrr
2019-07-18 18:41:21 +02:00
committed by abcdefg30
parent bfcdb3a8a2
commit 30c2e6b4d2
4 changed files with 25 additions and 26 deletions

View File

@@ -116,9 +116,16 @@ namespace OpenRA.Mods.Common.Traits
if (currentTransform == null)
self.QueueActivity(order.Queued, activity);
}
else if (order.OrderString == "Stop")
{
// We don't want Stop orders from traits other than Mobile or Aircraft to cancel Resupply activity.
// Resupply is always either the main activity or a child of ReturnToBase.
// TODO: This should generally only cancel activities queued by this trait.
if (self.CurrentActivity == null || self.CurrentActivity is Resupply || self.CurrentActivity is ReturnToBase)
return;
if (order.OrderString == "Stop")
self.CancelActivity();
}
}
string IOrderVoice.VoicePhraseForOrder(Actor self, Order order)