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:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user