diff --git a/OpenRA.Mods.RA/Move/Mobile.cs b/OpenRA.Mods.RA/Move/Mobile.cs index f380906945..ad75f3f9cf 100755 --- a/OpenRA.Mods.RA/Move/Mobile.cs +++ b/OpenRA.Mods.RA/Move/Mobile.cs @@ -81,7 +81,7 @@ namespace OpenRA.Mods.RA.Move return passability.ToBits(); } - public readonly Dictionary SubCellOffsets = new Dictionary() + public static readonly Dictionary SubCellOffsets = new Dictionary() { {SubCell.TopLeft, new PVecInt(-7,-6)}, {SubCell.TopRight, new PVecInt(6,-6)}, @@ -197,7 +197,7 @@ namespace OpenRA.Mods.RA.Move if (init.Contains()) { this.__fromCell = this.__toCell = init.Get(); - this.PxPosition = Util.CenterOfCell(fromCell) + info.SubCellOffsets[fromSubCell]; + this.PxPosition = Util.CenterOfCell(fromCell) + MobileInfo.SubCellOffsets[fromSubCell]; } this.Facing = init.Contains() ? init.Get() : info.InitialFacing; @@ -207,7 +207,7 @@ namespace OpenRA.Mods.RA.Move public void SetPosition(Actor self, CPos cell) { SetLocation(cell,fromSubCell, cell,fromSubCell); - PxPosition = Util.CenterOfCell(fromCell) + Info.SubCellOffsets[fromSubCell]; + PxPosition = Util.CenterOfCell(fromCell) + MobileInfo.SubCellOffsets[fromSubCell]; FinishedMoving(self); } diff --git a/OpenRA.Mods.RA/Move/Move.cs b/OpenRA.Mods.RA/Move/Move.cs index b86f2278cc..6b35e2acf0 100755 --- a/OpenRA.Mods.RA/Move/Move.cs +++ b/OpenRA.Mods.RA/Move/Move.cs @@ -144,8 +144,8 @@ namespace OpenRA.Mods.RA.Move mobile.SetLocation( mobile.fromCell, mobile.fromSubCell, nextCell.Value.First, nextCell.Value.Second ); var move = new MoveFirstHalf( this, - Util.CenterOfCell( mobile.fromCell ) + mobile.Info.SubCellOffsets[mobile.fromSubCell], - Util.BetweenCells( mobile.fromCell, mobile.toCell ) + (mobile.Info.SubCellOffsets[mobile.fromSubCell] + mobile.Info.SubCellOffsets[mobile.toSubCell] ) / 2, + Util.CenterOfCell( mobile.fromCell ) + MobileInfo.SubCellOffsets[mobile.fromSubCell], + Util.BetweenCells( mobile.fromCell, mobile.toCell ) + (MobileInfo.SubCellOffsets[mobile.fromSubCell] + MobileInfo.SubCellOffsets[mobile.toSubCell] ) / 2, mobile.Facing, mobile.Facing, 0 ); @@ -335,15 +335,15 @@ namespace OpenRA.Mods.RA.Move protected override MovePart OnComplete( Actor self, Mobile mobile, Move parent ) { - var fromSubcellOffset = mobile.Info.SubCellOffsets[mobile.fromSubCell]; - var toSubcellOffset = mobile.Info.SubCellOffsets[mobile.toSubCell]; + var fromSubcellOffset = MobileInfo.SubCellOffsets[mobile.fromSubCell]; + var toSubcellOffset = MobileInfo.SubCellOffsets[mobile.toSubCell]; var nextCell = parent.PopPath( self, mobile ); if( nextCell != null ) { if(IsTurn(mobile, nextCell.Value.First)) { - var nextSubcellOffset = mobile.Info.SubCellOffsets[nextCell.Value.Second]; + var nextSubcellOffset = MobileInfo.SubCellOffsets[nextCell.Value.Second]; var ret = new MoveFirstHalf( move, Util.BetweenCells( mobile.fromCell, mobile.toCell ) + (fromSubcellOffset + toSubcellOffset) / 2,