Fixed repairing landed airplanes (most likely #2365)

When an airplane was landed and ordered to another airstrip or service depot, the aproach distance was not properly calculated since it was not taken into effect that its current altitude is zero.
This commit is contained in:
Carko
2013-01-01 16:56:38 +01:00
committed by Chris Forbes
parent 22e2d3d0f4
commit f256742a0d

View File

@@ -52,7 +52,11 @@ namespace OpenRA.Mods.RA.Air
var speed = .2f * aircraft.MovementSpeed;
var approachStart = landPos.ToFloat2() - new float2(aircraft.Altitude * speed, 0);
/* if the aircraft is on the ground, it will take off to the cruise altitude first before approaching */
var altitude = aircraft.Altitude;
if (altitude == 0) altitude = self.Info.Traits.Get<PlaneInfo>().CruiseAltitude;
var approachStart = landPos.ToFloat2() - new float2(altitude * speed, 0);
var turnRadius = (128f / self.Info.Traits.Get<AircraftInfo>().ROT) * speed / (float)Math.PI;
/* work out the center points */