Remove ResupplyAircraft and AllowYieldingReservation

The few extra things those two activities did can be done
in Resupply, making them redundant.
This commit is contained in:
reaperrr
2019-04-22 20:12:21 +02:00
committed by Paul Chote
parent 4a06c66dbd
commit bc0d8ca015
9 changed files with 22 additions and 94 deletions

View File

@@ -19,19 +19,19 @@ namespace OpenRA.Mods.Common.Scripting
[ScriptPropertyGroup("Movement")]
public class AircraftProperties : ScriptActorProperties, Requires<AircraftInfo>
{
readonly AircraftInfo aircraftInfo;
readonly Aircraft aircraft;
public AircraftProperties(ScriptContext context, Actor self)
: base(context, self)
{
aircraftInfo = self.Info.TraitInfo<AircraftInfo>();
aircraft = self.Trait<Aircraft>();
}
[ScriptActorPropertyActivity]
[Desc("Fly within the cell grid.")]
public void Move(CPos cell)
{
if (!aircraftInfo.CanHover)
if (!aircraft.Info.CanHover)
Self.QueueActivity(new Fly(Self, Target.FromCell(Self.World, cell)));
else
Self.QueueActivity(new HeliFly(Self, Target.FromCell(Self.World, cell)));
@@ -55,7 +55,10 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Starts the resupplying activity when being on a host building.")]
public void Resupply()
{
Self.QueueActivity(new ResupplyAircraft(Self));
var atLandAltitude = Self.World.Map.DistanceAboveTerrain(Self.CenterPosition) == aircraft.Info.LandAltitude;
var host = aircraft.GetActorBelow();
if (atLandAltitude && host != null)
Self.QueueActivity(new Resupply(Self, host, WDist.Zero));
}
}
}