diff --git a/OpenRA.Mods.Common/Activities/UnloadCargo.cs b/OpenRA.Mods.Common/Activities/UnloadCargo.cs index cce65675ad..41fe74868c 100644 --- a/OpenRA.Mods.Common/Activities/UnloadCargo.cs +++ b/OpenRA.Mods.Common/Activities/UnloadCargo.cs @@ -25,6 +25,7 @@ namespace OpenRA.Mods.Common.Activities readonly INotifyUnload[] notifiers; readonly bool unloadAll; readonly Aircraft aircraft; + readonly Mobile mobile; readonly bool assignTargetOnFirstRun; readonly WDist unloadRange; @@ -44,6 +45,7 @@ namespace OpenRA.Mods.Common.Activities notifiers = self.TraitsImplementing().ToArray(); this.unloadAll = unloadAll; aircraft = self.TraitOrDefault(); + mobile = self.TraitOrDefault(); this.destination = destination; this.unloadRange = unloadRange; } @@ -80,7 +82,7 @@ namespace OpenRA.Mods.Common.Activities QueueChild(new Land(self, destination, unloadRange)); takeOffAfterUnload = !aircraft.AtLandAltitude; } - else + else if (mobile != null) { var cell = self.World.Map.Clamp(this.self.World.Map.CellContaining(destination.CenterPosition)); QueueChild(new Move(self, cell, unloadRange));