Fix force-landed transports taking off after (un)loading passengers.

This commit is contained in:
Paul Chote
2019-06-30 18:10:53 +01:00
committed by teinarss
parent da0b24e891
commit 5d8b6d6057
2 changed files with 13 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ namespace OpenRA.Mods.Common.Activities
readonly WDist unloadRange;
Target destination;
bool takeOffAfterUnload;
public UnloadCargo(Actor self, WDist unloadRange, bool unloadAll = true)
: this(self, Target.Invalid, unloadRange, unloadAll)
@@ -74,7 +75,11 @@ namespace OpenRA.Mods.Common.Activities
// Move to the target destination
if (aircraft != null)
{
// Queue the activity even if already landed in case self.Location != destination
QueueChild(self, new Land(self, destination, unloadRange));
takeOffAfterUnload = !aircraft.AtLandAltitude;
}
else
{
var cell = self.World.Map.Clamp(this.self.World.Map.CellContaining(destination.CenterPosition));
@@ -135,7 +140,7 @@ namespace OpenRA.Mods.Common.Activities
if (cargo.Info.AfterUnloadDelay > 0)
QueueChild(self, new Wait(cargo.Info.AfterUnloadDelay, false), true);
if (aircraft != null && !aircraft.Info.LandWhenIdle)
if (takeOffAfterUnload)
QueueChild(self, new TakeOff(self), true);
}