Begin unhardcoding 128 map size; Trees; Waypoints

This commit is contained in:
Paul Chote
2010-03-03 09:42:45 +13:00
parent f1211e4414
commit ae2bbae16c
14 changed files with 295 additions and 249 deletions

View File

@@ -35,10 +35,11 @@ namespace OpenRA
public PathFinder( World world )
{
this.world = world;
var map = world.Map;
for (var umt = UnitMovementType.Foot; umt <= UnitMovementType.Float; umt++)
passableCost[(int)umt] = new float[128, 128];
for( int x = 0 ; x < 128 ; x++ )
for( int y = 0 ; y < 128 ; y++ )
passableCost[(int)umt] = new float[map.MapSize, map.MapSize];
for( int x = 0 ; x < map.MapSize ; x++ )
for( int y = 0 ; y < map.MapSize ; y++ )
for (var umt = UnitMovementType.Foot; umt <= UnitMovementType.Float; umt++ )
passableCost[(int)umt][ x, y ] = ( world.Map.IsInMap( x, y ) )
? (float)TerrainCosts.Cost( umt, world.TileSet.GetWalkability( world.Map.MapTiles[ x, y ] ) )