diff --git a/OpenRA.Mods.RA/Air/Helicopter.cs b/OpenRA.Mods.RA/Air/Helicopter.cs index 4a8d140ba2..d5e3b7c903 100755 --- a/OpenRA.Mods.RA/Air/Helicopter.cs +++ b/OpenRA.Mods.RA/Air/Helicopter.cs @@ -130,22 +130,22 @@ namespace OpenRA.Mods.RA.Air .Where(a => a.HasTrait()); var f = otherHelis - .Select(h => GetRepulseForce(self, h, h.Trait())) + .Select(h => GetRepulseForce(self, h)) .Aggregate(int2.Zero, (a, b) => a + b); - int RepulsionFacing = Util.GetFacing( f.ToFloat2(), -1 ); + int RepulsionFacing = Util.GetFacing( f, -1 ); if( RepulsionFacing != -1 ) aircraft.TickMove( 1024 * aircraft.MovementSpeed, RepulsionFacing ); } // Returns an int2 in subPx units - public int2 GetRepulseForce(Actor self, Actor h, Aircraft hAir) + public int2 GetRepulseForce(Actor self, Actor h) { if (self == h) return int2.Zero; - if( hAir.Altitude < Altitude ) + if( h.Trait().Altitude < Altitude ) return int2.Zero; - var d = (self.CenterLocation - h.CenterLocation).ToInt2(); + var d = self.CenterLocation - h.CenterLocation; if (d.Length > Info.IdealSeparation) return int2.Zero;