Perf fixes for low unit-counts. Added sanity checks - not enabled by default.

This commit is contained in:
Bob
2009-10-28 19:43:04 +13:00
parent 9f237f2530
commit cc1be5b31c
4 changed files with 45 additions and 25 deletions

View File

@@ -54,7 +54,7 @@ namespace OpenRa.Game
for( int i = 0 ; i < path.Count ; i++ )
{
var sl = path[ i ] + offset;
if( Game.BuildingInfluence.GetBuildingAt( path[ i ] ) == null & Game.UnitInfluence.GetUnitAt( path[ i ] ) == null )
if( i == 0 || Game.BuildingInfluence.GetBuildingAt( path[ i ] ) == null & Game.UnitInfluence.GetUnitAt( path[ i ] ) == null )
{
queue.Add( new PathDistance( estimator( sl - offset ), sl ) );
cellInfo[ sl.X, sl.Y ] = new CellInfo( cost, prev, false );