Revert "Suppress MoveIntoWorldInit for map-placed Mobile actors."
This reverts commit f0c28cc15334c7224630c375d669274f8da8fb31.
This commit is contained in:
@@ -251,9 +251,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
SetPosition(self, init.Get<CenterPositionInit, WPos>());
|
SetPosition(self, init.Get<CenterPositionInit, WPos>());
|
||||||
|
|
||||||
Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : Info.InitialFacing;
|
Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : Info.InitialFacing;
|
||||||
|
|
||||||
// SkipMoveIntoWorldInit is deliberately ignored for Aircraft
|
|
||||||
// MoveIntoWorld must run for aircraft for map-placed actors to be associated with their airfields
|
|
||||||
moveIntoWorldDelay = init.Contains<MoveIntoWorldDelayInit>() ? init.Get<MoveIntoWorldDelayInit, int>() : 0;
|
moveIntoWorldDelay = init.Contains<MoveIntoWorldDelayInit>() ? init.Get<MoveIntoWorldDelayInit, int>() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
readonly Actor self;
|
readonly Actor self;
|
||||||
readonly Lazy<IEnumerable<int>> speedModifiers;
|
readonly Lazy<IEnumerable<int>> speedModifiers;
|
||||||
readonly int? moveIntoWorldDelay;
|
readonly int moveIntoWorldDelay;
|
||||||
|
|
||||||
#region IMove CurrentMovementTypes
|
#region IMove CurrentMovementTypes
|
||||||
MovementType movementTypes;
|
MovementType movementTypes;
|
||||||
@@ -243,7 +243,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (init.Contains<CenterPositionInit>())
|
if (init.Contains<CenterPositionInit>())
|
||||||
SetVisualPosition(self, init.Get<CenterPositionInit, WPos>());
|
SetVisualPosition(self, init.Get<CenterPositionInit, WPos>());
|
||||||
|
|
||||||
if (!init.Contains<SkipMoveIntoWorldInit>())
|
|
||||||
moveIntoWorldDelay = init.Contains<MoveIntoWorldDelayInit>() ? init.Get<MoveIntoWorldDelayInit, int>() : 0;
|
moveIntoWorldDelay = init.Contains<MoveIntoWorldDelayInit>() ? init.Get<MoveIntoWorldDelayInit, int>() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -899,7 +898,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
Activity ICreationActivity.GetCreationActivity()
|
Activity ICreationActivity.GetCreationActivity()
|
||||||
{
|
{
|
||||||
return moveIntoWorldDelay.HasValue ? MoveIntoWorld(self, moveIntoWorldDelay.Value) : null;
|
return MoveIntoWorld(self, moveIntoWorldDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
class MoveOrderTargeter : IOrderTargeter
|
class MoveOrderTargeter : IOrderTargeter
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
new LocationInit(sp + unitGroup.BaseActorOffset),
|
new LocationInit(sp + unitGroup.BaseActorOffset),
|
||||||
new OwnerInit(p),
|
new OwnerInit(p),
|
||||||
new SkipMakeAnimsInit(),
|
new SkipMakeAnimsInit(),
|
||||||
new SkipMoveIntoWorldInit(),
|
|
||||||
new FacingInit(unitGroup.BaseActorFacing < 0 ? w.SharedRandom.Next(256) : unitGroup.BaseActorFacing),
|
new FacingInit(unitGroup.BaseActorFacing < 0 ? w.SharedRandom.Next(256) : unitGroup.BaseActorFacing),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
var initDict = actorReference.InitDict;
|
var initDict = actorReference.InitDict;
|
||||||
initDict.Add(new SkipMakeAnimsInit());
|
initDict.Add(new SkipMakeAnimsInit());
|
||||||
initDict.Add(new SkipMoveIntoWorldInit());
|
|
||||||
initDict.Add(new SpawnedByMapInit(kv.Key));
|
initDict.Add(new SpawnedByMapInit(kv.Key));
|
||||||
|
|
||||||
if (PreventMapSpawn(world, actorReference, preventMapSpawns))
|
if (PreventMapSpawn(world, actorReference, preventMapSpawns))
|
||||||
@@ -64,7 +63,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class SkipMakeAnimsInit : IActorInit, ISuppressInitExport { }
|
public class SkipMakeAnimsInit : IActorInit, ISuppressInitExport { }
|
||||||
public class SkipMoveIntoWorldInit : IActorInit, ISuppressInitExport { }
|
|
||||||
public class SpawnedByMapInit : IActorInit<string>, ISuppressInitExport
|
public class SpawnedByMapInit : IActorInit<string>, ISuppressInitExport
|
||||||
{
|
{
|
||||||
public readonly string Name;
|
public readonly string Name;
|
||||||
|
|||||||
Reference in New Issue
Block a user