Refactored in new enum SubCell

This commit is contained in:
atlimit8
2014-08-17 02:35:54 -05:00
parent 27ad5208fb
commit 63c28ee4d7
17 changed files with 121 additions and 110 deletions

View File

@@ -80,7 +80,7 @@ namespace OpenRA.Mods.RA.Move
}
}
public List<CPos> FindUnitPathToRange(CPos src, int srcSub, WPos target, WRange range, Actor self)
public List<CPos> FindUnitPathToRange(CPos src, SubCell srcSub, WPos target, WRange range, Actor self)
{
using (new PerfSample("Pathfinder"))
{
@@ -89,7 +89,7 @@ namespace OpenRA.Mods.RA.Move
var rangeSquared = range.Range*range.Range;
// Correct for SubCell offset
target -= self.World.Map.SubCellOffsets[srcSub];
target -= self.World.Map.OffsetOf(srcSub);
// Select only the tiles that are within range from the requested SubCell
// This assumes that the SubCell does not change during the path traversal