Remove HeliFlyCircle activity
FlyCircle actually works fine for D2k Carryalls, and no other place used this.
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2019 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version. For more
|
||||
* information, see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
public class HeliFlyCircle : Activity
|
||||
{
|
||||
readonly Aircraft aircraft;
|
||||
readonly int turnSpeedOverride;
|
||||
|
||||
public HeliFlyCircle(Actor self, int turnSpeedOverride = -1)
|
||||
{
|
||||
aircraft = self.Trait<Aircraft>();
|
||||
this.turnSpeedOverride = turnSpeedOverride;
|
||||
}
|
||||
|
||||
public override Activity Tick(Actor self)
|
||||
{
|
||||
// Refuse to take off if it would land immediately again.
|
||||
if (aircraft.ForceLanding)
|
||||
{
|
||||
Cancel(self);
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
if (IsCanceling)
|
||||
return NextActivity;
|
||||
|
||||
if (HeliFly.AdjustAltitude(self, aircraft, aircraft.Info.CruiseAltitude))
|
||||
return this;
|
||||
|
||||
var move = aircraft.FlyStep(aircraft.Facing);
|
||||
aircraft.SetPosition(self, aircraft.CenterPosition + move);
|
||||
|
||||
var desiredFacing = aircraft.Facing + 64;
|
||||
var turnSpeed = turnSpeedOverride > -1 ? turnSpeedOverride : aircraft.TurnSpeed;
|
||||
aircraft.Facing = Util.TickFacing(aircraft.Facing, desiredFacing, turnSpeed);
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,6 @@
|
||||
<Compile Include="Activities\Air\FlyTimed.cs" />
|
||||
<Compile Include="Activities\Air\HeliAttack.cs" />
|
||||
<Compile Include="Activities\Air\HeliFly.cs" />
|
||||
<Compile Include="Activities\Air\HeliFlyCircle.cs" />
|
||||
<Compile Include="Activities\Air\HeliLand.cs" />
|
||||
<Compile Include="Activities\Air\Land.cs" />
|
||||
<Compile Include="Activities\Air\ReturnToBase.cs" />
|
||||
|
||||
@@ -619,11 +619,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
self.QueueActivity(new FlyCircle(self, -1, Info.IdleTurnSpeed > -1 ? Info.IdleTurnSpeed : TurnSpeed));
|
||||
else if (atLandAltitude && !CanLand(self.Location) && ReservedActor == null)
|
||||
self.QueueActivity(new TakeOff(self));
|
||||
else if (Info.CanHover && self.Info.HasTraitInfo<AutoCarryallInfo>() && Info.IdleTurnSpeed > -1)
|
||||
else if (Info.CanHover && Info.IdleTurnSpeed > 0)
|
||||
{
|
||||
// Temporary HACK for the AutoCarryall special case (needs CanHover, but also HeliFlyCircle on idle).
|
||||
// Temporary HACK for the AutoCarryall special case (needs CanHover, but also FlyCircle on idle).
|
||||
// Will go away soon (in a separate PR) with the arrival of ActionsWhenIdle.
|
||||
self.QueueActivity(new HeliFlyCircle(self, Info.IdleTurnSpeed > -1 ? Info.IdleTurnSpeed : TurnSpeed));
|
||||
self.QueueActivity(new FlyCircle(self, -1, Info.IdleTurnSpeed > -1 ? Info.IdleTurnSpeed : TurnSpeed));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user