Repath around blocking units or structures.

This commit is contained in:
Bob
2009-10-28 17:59:09 +13:00
parent 58f9347cb7
commit 222b72a679
4 changed files with 245 additions and 181 deletions

View File

@@ -25,7 +25,13 @@ namespace OpenRa.Game
Update(u);
}
public Actor GetUnitAt(int2 a) { return influence[a.X, a.Y]; }
public Actor GetUnitAt( int2 a )
{
var actor = influence[ a.X, a.Y ];
if( actor != null && !actor.traits.Get<Mobile>().OccupiedCells().Contains( a ) )
throw new InvalidOperationException( "UIM: Unit is not in influenced square" );
return actor;
}
public void Add(Mobile a)
{