Add IdleBehavior enum to Aircraft
This commit is contained in:
@@ -114,7 +114,8 @@ namespace OpenRA.Mods.Common.Activities
|
||||
// TODO: It would be better to not take off at all, but we lack the plumbing to detect current airborne/landed state.
|
||||
// If the aircraft lands when idle and is idle, we let the default idle handler manage this.
|
||||
// TODO: Remove this after fixing all activities to work properly with arbitrary starting altitudes.
|
||||
var skipHeightAdjustment = aircraft.Info.LandWhenIdle && self.CurrentActivity.IsCanceling && self.CurrentActivity.NextActivity == null;
|
||||
var landWhenIdle = aircraft.Info.IdleBehavior == IdleBehaviorType.Land;
|
||||
var skipHeightAdjustment = landWhenIdle && self.CurrentActivity.IsCanceling && self.CurrentActivity.NextActivity == null;
|
||||
if (aircraft.Info.CanHover && !skipHeightAdjustment && dat != aircraft.Info.CruiseAltitude)
|
||||
{
|
||||
if (dat <= aircraft.LandAltitude)
|
||||
|
||||
@@ -81,7 +81,8 @@ namespace OpenRA.Mods.Common.Activities
|
||||
// If the aircraft lands when idle and is idle, continue landing,
|
||||
// otherwise climb back to CruiseAltitude.
|
||||
// TODO: Remove this after fixing all activities to work properly with arbitrary starting altitudes.
|
||||
var continueLanding = aircraft.Info.LandWhenIdle && self.CurrentActivity.IsCanceling && self.CurrentActivity.NextActivity == null;
|
||||
var shouldLand = aircraft.Info.IdleBehavior == IdleBehaviorType.Land;
|
||||
var continueLanding = shouldLand && self.CurrentActivity.IsCanceling && self.CurrentActivity.NextActivity == null;
|
||||
if (!continueLanding)
|
||||
{
|
||||
var dat = self.World.Map.DistanceAboveTerrain(aircraft.CenterPosition);
|
||||
|
||||
Reference in New Issue
Block a user