Allow units to move between subcells. Visually not quite right.

This commit is contained in:
Paul Chote
2011-02-04 11:03:38 +13:00
parent 4aaafd18f1
commit 9c63292a83
3 changed files with 31 additions and 19 deletions

View File

@@ -55,8 +55,14 @@ namespace OpenRA.Traits
if (!AnyUnitsAt(a))
return true;
return new[]{SubCell.BottomLeft, SubCell.BottomRight, SubCell.Center,
SubCell.TopLeft, SubCell.TopRight}.Any(b => !AnyUnitsAt(a,b));
return new[]{SubCell.TopLeft, SubCell.TopRight, SubCell.Center,
SubCell.BottomLeft, SubCell.BottomRight}.Any(b => !AnyUnitsAt(a,b));
}
public SubCell GetFreeSubcell(int2 a, SubCell preferred)
{
return new[]{preferred, SubCell.TopLeft, SubCell.TopRight, SubCell.Center,
SubCell.BottomLeft, SubCell.BottomRight}.First(b => !AnyUnitsAt(a,b));
}
public bool AnyUnitsAt(int2 a)