Remove IsPlane hack

The new VTOL boolean together with CanHover is enough to replace this.
This commit is contained in:
reaperrr
2017-08-21 20:41:55 +02:00
committed by Matthias Mailänder
parent 28ffcfea3c
commit 2f66f83051
2 changed files with 18 additions and 23 deletions

View File

@@ -19,19 +19,19 @@ namespace OpenRA.Mods.Common.Scripting
[ScriptPropertyGroup("Movement")]
public class AircraftProperties : ScriptActorProperties, Requires<AircraftInfo>
{
readonly bool isPlane;
readonly AircraftInfo aircraftInfo;
public AircraftProperties(ScriptContext context, Actor self)
: base(context, self)
{
isPlane = self.Trait<Aircraft>().IsPlane;
aircraftInfo = self.Info.TraitInfo<AircraftInfo>();
}
[ScriptActorPropertyActivity]
[Desc("Fly within the cell grid.")]
public void Move(CPos cell)
{
if (isPlane)
if (!aircraftInfo.CanHover)
Self.QueueActivity(new Fly(Self, Target.FromCell(Self.World, cell)));
else
Self.QueueActivity(new HeliFly(Self, Target.FromCell(Self.World, cell)));
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Return to the base, which is either the destination given, or an auto-selected one otherwise.")]
public void ReturnToBase(Actor destination = null)
{
if (isPlane)
if (!aircraftInfo.CanHover)
Self.QueueActivity(new ReturnToBase(Self, false, destination));
else
Self.QueueActivity(new HeliReturnToBase(Self, false, destination));