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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user