Harvesting works better, and other related stuff.

This commit is contained in:
Bob
2009-11-05 13:23:23 +13:00
parent 7e0b0541e2
commit edc4a8e6e7
12 changed files with 191 additions and 143 deletions

View File

@@ -47,6 +47,14 @@ namespace OpenRa.Game
}
}
[System.Diagnostics.Conditional( "SANITY_CHECKS" )]
void SanityCheckAdd( Mobile a )
{
foreach( var c in a.OccupiedCells() )
if( influence[c.X, c.Y] != null )
throw new InvalidOperationException( "UIM: Sanity check failed (Add)" );
}
public Actor GetUnitAt( int2 a )
{
return influence[ a.X, a.Y ];
@@ -54,6 +62,7 @@ namespace OpenRa.Game
public void Add(Mobile a)
{
SanityCheckAdd(a);
foreach (var c in a.OccupiedCells())
influence[c.X, c.Y] = a.self;
}