diff --git a/OpenRA.Mods.RA/Air/Helicopter.cs b/OpenRA.Mods.RA/Air/Helicopter.cs index 1e5a267af5..6b0356acd7 100755 --- a/OpenRA.Mods.RA/Air/Helicopter.cs +++ b/OpenRA.Mods.RA/Air/Helicopter.cs @@ -31,6 +31,7 @@ namespace OpenRA.Mods.RA.Air class Helicopter : Aircraft, ITick, IIssueOrder, IResolveOrder, IOrderVoice { HelicopterInfo Info; + bool firstTick = true; public Helicopter( ActorInitializer init, HelicopterInfo info) : base( init, info ) { @@ -121,6 +122,24 @@ namespace OpenRA.Mods.RA.Air public void Tick(Actor self) { + if (firstTick) + { + firstTick = false; + if (self.Trait().Altitude == 0) + { + /* not spawning in the air, so try to assoc. with our afld. this is a hack. */ + var afld = self.World.FindUnits(self.CenterLocation, self.CenterLocation) + .FirstOrDefault(a => a.HasTrait()); + + if (afld != null) + { + var res = afld.Trait(); + if (res != null) + reservation = res.Reserve(afld, self, this); + } + } + } + var aircraft = self.Trait(); if (aircraft.Altitude <= 0) return;