Fix a bug in Map/CellLayer.Contains.

This commit is contained in:
Paul Chote
2015-06-08 22:49:10 +01:00
parent 6e09c62fdd
commit ba2d499e5d
2 changed files with 12 additions and 0 deletions

View File

@@ -127,6 +127,12 @@ namespace OpenRA
public bool Contains(CPos cell)
{
// .ToMPos() returns the same result if the X and Y coordinates
// are switched. X < Y is invalid in the Diamond coordinate system,
// so we pre-filter these to avoid returning the wrong result
if (Shape == TileShape.Diamond && cell.X < cell.Y)
return false;
return Contains(cell.ToMPos(Shape));
}