temporarily made all units block pathing

This commit is contained in:
Chris Forbes
2009-10-24 22:45:37 +13:00
parent 021e41a5bf
commit e61ef4a93f
2 changed files with 5 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ namespace OpenRa.Game
LoadMapBuildings(mapFile);
LoadMapUnits(mapFile);
pathFinder = new PathFinder(map, terrain.tileSet, BuildingInfluence);
pathFinder = new PathFinder(map, terrain.tileSet);
network = new Network();

View File

@@ -9,12 +9,10 @@ namespace OpenRa.Game
{
double[ , ] passableCost = new double[ 128, 128 ];
Map map;
BuildingInfluenceMap bim;
public PathFinder(Map map, TileSet tileSet, BuildingInfluenceMap bim)
public PathFinder(Map map, TileSet tileSet)
{
this.map = map;
this.bim = bim;
for( int x = 0 ; x < 128 ; x++ )
for( int y = 0 ; y < 128 ; y++ )
@@ -64,7 +62,9 @@ namespace OpenRa.Game
continue;
if( passableCost[ newHere.X, newHere.Y ] == double.PositiveInfinity )
continue;
if (bim.GetBuildingAt(newHere - offset) != null)
if (Game.BuildingInfluence.GetBuildingAt(newHere - offset) != null)
continue;
if (Game.UnitInfluence.GetUnitAt(newHere - offset) != null)
continue;
double cellCost = ( ( d.X * d.Y != 0 ) ? 1.414213563 : 1.0 ) * passableCost[ newHere.X, newHere.Y ];