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

@@ -13,6 +13,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Warheads;
using OpenRA.Primitives;
using OpenRA.Support;
@@ -206,6 +207,12 @@ namespace OpenRA.Mods.Common.Traits
// Some 3rd-party mods rely on this being public
public virtual void OnStopOrder(Actor self)
{
// 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;
self.CancelActivity();
}