Replace MoveIntoWorld with ReturnToCell/AssociateWithAirfield.
This commit is contained in:
@@ -220,7 +220,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
IEnumerable<CPos> landingCells = Enumerable.Empty<CPos>();
|
||||
bool requireForceMove;
|
||||
int moveIntoWorldDelay;
|
||||
int creationActivityDelay;
|
||||
|
||||
public static WPos GroundPosition(Actor self)
|
||||
{
|
||||
@@ -251,7 +251,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
SetPosition(self, init.Get<CenterPositionInit, WPos>());
|
||||
|
||||
Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : Info.InitialFacing;
|
||||
moveIntoWorldDelay = init.Contains<MoveIntoWorldDelayInit>() ? init.Get<MoveIntoWorldDelayInit, int>() : 0;
|
||||
|
||||
if (init.Contains<CreationActivityDelayInit>())
|
||||
creationActivityDelay = init.Get<CreationActivityDelayInit, int>();
|
||||
}
|
||||
|
||||
public WDist LandAltitude
|
||||
@@ -841,18 +843,15 @@ namespace OpenRA.Mods.Common.Traits
|
||||
initialTargetPosition, targetLineColor);
|
||||
}
|
||||
|
||||
public Activity MoveIntoWorld(Actor self, int delay = 0)
|
||||
{
|
||||
return new MoveIntoWorldActivity(self, delay);
|
||||
}
|
||||
public Activity ReturnToCell(Actor self) { return null; }
|
||||
|
||||
class MoveIntoWorldActivity : Activity
|
||||
class AssociateWithAirfieldActivity : Activity
|
||||
{
|
||||
readonly Actor self;
|
||||
readonly Aircraft aircraft;
|
||||
readonly int delay;
|
||||
|
||||
public MoveIntoWorldActivity(Actor self, int delay = 0)
|
||||
public AssociateWithAirfieldActivity(Actor self, int delay = 0)
|
||||
{
|
||||
this.self = self;
|
||||
aircraft = self.Trait<Aircraft>();
|
||||
@@ -1164,7 +1163,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
Activity ICreationActivity.GetCreationActivity()
|
||||
{
|
||||
return MoveIntoWorld(self, moveIntoWorldDelay);
|
||||
return new AssociateWithAirfieldActivity(self, creationActivityDelay);
|
||||
}
|
||||
|
||||
public class AircraftMoveOrderTargeter : IOrderTargeter
|
||||
|
||||
Reference in New Issue
Block a user