Add World parameter to Util.BetweenCells.
This commit is contained in:
@@ -65,7 +65,7 @@ namespace OpenRA.Traits
|
|||||||
return a / step;
|
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);
|
return WPos.Lerp(from.CenterPosition, to.CenterPosition, 1, 2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ namespace OpenRA.Mods.RA.Move
|
|||||||
var move = new MoveFirstHalf(
|
var move = new MoveFirstHalf(
|
||||||
this,
|
this,
|
||||||
mobile.fromCell.CenterPosition + MobileInfo.SubCellOffsets[mobile.fromSubCell],
|
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,
|
||||||
mobile.Facing,
|
mobile.Facing,
|
||||||
0);
|
0);
|
||||||
@@ -359,8 +359,8 @@ namespace OpenRA.Mods.RA.Move
|
|||||||
var nextSubcellOffset = MobileInfo.SubCellOffsets[nextCell.Value.Second];
|
var nextSubcellOffset = MobileInfo.SubCellOffsets[nextCell.Value.Second];
|
||||||
var ret = new MoveFirstHalf(
|
var ret = new MoveFirstHalf(
|
||||||
move,
|
move,
|
||||||
Util.BetweenCells(mobile.fromCell, mobile.toCell) + (fromSubcellOffset + toSubcellOffset) / 2,
|
Util.BetweenCells(self.World, mobile.fromCell, mobile.toCell) + (fromSubcellOffset + toSubcellOffset) / 2,
|
||||||
Util.BetweenCells(mobile.toCell, nextCell.Value.First) + (toSubcellOffset + nextSubcellOffset) / 2,
|
Util.BetweenCells(self.World, mobile.toCell, nextCell.Value.First) + (toSubcellOffset + nextSubcellOffset) / 2,
|
||||||
mobile.Facing,
|
mobile.Facing,
|
||||||
Util.GetNearestFacing(mobile.Facing, Util.GetFacing(nextCell.Value.First - mobile.toCell, mobile.Facing)),
|
Util.GetNearestFacing(mobile.Facing, Util.GetFacing(nextCell.Value.First - mobile.toCell, mobile.Facing)),
|
||||||
moveFraction - moveFractionTotal);
|
moveFraction - moveFractionTotal);
|
||||||
@@ -374,7 +374,7 @@ namespace OpenRA.Mods.RA.Move
|
|||||||
|
|
||||||
var ret2 = new MoveSecondHalf(
|
var ret2 = new MoveSecondHalf(
|
||||||
move,
|
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.toCell.CenterPosition + toSubcellOffset,
|
||||||
mobile.Facing,
|
mobile.Facing,
|
||||||
mobile.Facing,
|
mobile.Facing,
|
||||||
|
|||||||
Reference in New Issue
Block a user