Prevent things from tweaking mobile position directly.
This commit is contained in:
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Move
|
||||
? WPos.Lerp(start, end, ticks, length - 1)
|
||||
: end;
|
||||
|
||||
mobile.PxPosition = PPos.FromWPos(pos);
|
||||
mobile.AdjustPxPosition(self, PPos.FromWPos(pos));
|
||||
if (++ticks >= length)
|
||||
{
|
||||
mobile.IsMoving = false;
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace OpenRA.Mods.RA.Move
|
||||
|
||||
public int ROT { get { return Info.ROT; } }
|
||||
|
||||
[Sync] public PPos PxPosition { get; set; }
|
||||
[Sync] public PPos PxPosition { get; private set; }
|
||||
[Sync] public CPos fromCell { get { return __fromCell; } }
|
||||
[Sync] public CPos toCell { get { return __toCell; } }
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ namespace OpenRA.Mods.RA.Move
|
||||
|
||||
void UpdateCenterLocation(Actor self, Mobile mobile)
|
||||
{
|
||||
mobile.PxPosition = PPos.FromWPos(WPos.Lerp(from, to, moveFraction, moveFractionTotal));
|
||||
mobile.AdjustPxPosition(self, PPos.FromWPos(WPos.Lerp(from, to, moveFraction, moveFractionTotal)));
|
||||
|
||||
if (moveFraction >= moveFractionTotal)
|
||||
mobile.Facing = toFacing & 0xFF;
|
||||
@@ -402,9 +402,7 @@ namespace OpenRA.Mods.RA.Move
|
||||
|
||||
protected override MovePart OnComplete(Actor self, Mobile mobile, Move parent)
|
||||
{
|
||||
mobile.PxPosition = Util.CenterOfCell(mobile.toCell);
|
||||
mobile.SetLocation(mobile.toCell, mobile.toSubCell, mobile.toCell, mobile.toSubCell);
|
||||
mobile.FinishedMoving(self);
|
||||
mobile.SetPosition(self, mobile.toCell);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user