Add World parameter to Util.BetweenCells.

This commit is contained in:
Paul Chote
2013-09-17 21:53:18 +12:00
parent 086ec07eb6
commit b6d1d26eeb
2 changed files with 5 additions and 5 deletions

View File

@@ -65,7 +65,7 @@ namespace OpenRA.Traits
return a / step;
}
public static WPos BetweenCells(CPos from, CPos to)
public static WPos BetweenCells(World w, CPos from, CPos to)
{
return WPos.Lerp(from.CenterPosition, to.CenterPosition, 1, 2);
}

View File

@@ -152,7 +152,7 @@ namespace OpenRA.Mods.RA.Move
var move = new MoveFirstHalf(
this,
mobile.fromCell.CenterPosition + MobileInfo.SubCellOffsets[mobile.fromSubCell],
Util.BetweenCells(mobile.fromCell, mobile.toCell) + (MobileInfo.SubCellOffsets[mobile.fromSubCell] + MobileInfo.SubCellOffsets[mobile.toSubCell]) / 2,
Util.BetweenCells(self.World, mobile.fromCell, mobile.toCell) + (MobileInfo.SubCellOffsets[mobile.fromSubCell] + MobileInfo.SubCellOffsets[mobile.toSubCell]) / 2,
mobile.Facing,
mobile.Facing,
0);
@@ -359,8 +359,8 @@ namespace OpenRA.Mods.RA.Move
var nextSubcellOffset = MobileInfo.SubCellOffsets[nextCell.Value.Second];
var ret = new MoveFirstHalf(
move,
Util.BetweenCells(mobile.fromCell, mobile.toCell) + (fromSubcellOffset + toSubcellOffset) / 2,
Util.BetweenCells(mobile.toCell, nextCell.Value.First) + (toSubcellOffset + nextSubcellOffset) / 2,
Util.BetweenCells(self.World, mobile.fromCell, mobile.toCell) + (fromSubcellOffset + toSubcellOffset) / 2,
Util.BetweenCells(self.World, mobile.toCell, nextCell.Value.First) + (toSubcellOffset + nextSubcellOffset) / 2,
mobile.Facing,
Util.GetNearestFacing(mobile.Facing, Util.GetFacing(nextCell.Value.First - mobile.toCell, mobile.Facing)),
moveFraction - moveFractionTotal);
@@ -374,7 +374,7 @@ namespace OpenRA.Mods.RA.Move
var ret2 = new MoveSecondHalf(
move,
Util.BetweenCells(mobile.fromCell, mobile.toCell) + (fromSubcellOffset + toSubcellOffset) / 2,
Util.BetweenCells(self.World, mobile.fromCell, mobile.toCell) + (fromSubcellOffset + toSubcellOffset) / 2,
mobile.toCell.CenterPosition + toSubcellOffset,
mobile.Facing,
mobile.Facing,