Prevent things from tweaking mobile position directly.

This commit is contained in:
Paul Chote
2013-07-21 11:48:59 +12:00
parent 0676116d77
commit 3e9bc63d4e
3 changed files with 4 additions and 6 deletions

View File

@@ -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;
}
}