Convert (Dynamic)FacingInit, (Dynamic)TurretFacingInit to WAngle.
This commit is contained in:
@@ -75,18 +75,17 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
return init;
|
||||
}
|
||||
|
||||
// HACK: Forward compatibility for future WAngle facings
|
||||
// HACK: Backward compatibility for legacy int facings
|
||||
var facingInit = init as FacingInit;
|
||||
if (facingInit != null)
|
||||
{
|
||||
WAngle angle;
|
||||
if (value.TryGetClrValue(out angle))
|
||||
int facing;
|
||||
if (value.TryGetClrValue(out facing))
|
||||
{
|
||||
facingInit.Initialize(angle.Facing);
|
||||
facingInit.Initialize(WAngle.FromFacing(facing));
|
||||
Game.Debug("Initializing Facing with integers is deprecated. Use Angle instead.");
|
||||
return facingInit;
|
||||
}
|
||||
|
||||
Game.Debug("Initializing Facing with integers is deprecated. Use Angle instead.");
|
||||
}
|
||||
|
||||
var initializers = initType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
|
||||
|
||||
@@ -55,11 +55,12 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
}
|
||||
|
||||
if (entryLocation.HasValue && nextLocation.HasValue)
|
||||
initDict.Add(new FacingInit(Context.World.Map.FacingBetween(CPos.Zero, CPos.Zero + (nextLocation.Value - entryLocation.Value), WAngle.Zero).Facing));
|
||||
{
|
||||
var facing = Context.World.Map.FacingBetween(CPos.Zero, CPos.Zero + (nextLocation.Value - entryLocation.Value), WAngle.Zero);
|
||||
initDict.Add(new FacingInit(facing));
|
||||
}
|
||||
|
||||
var actor = Context.World.CreateActor(addToWorld, actorType, initDict);
|
||||
|
||||
return actor;
|
||||
return Context.World.CreateActor(addToWorld, actorType, initDict);
|
||||
}
|
||||
|
||||
void Move(Actor actor, CPos dest)
|
||||
|
||||
Reference in New Issue
Block a user