Units automatically path around known hazards (eg static base defenses). Test using SAM and TRAN.

Todo: Ignore hazards when force-moving; Apply only to known enemy hazards; Implement more hazard classes

Also add a few files I forgot from previous patches
This commit is contained in:
Paul Chote
2010-06-25 13:53:37 +12:00
parent 0aeca2aadc
commit 7ac8d0cf59
15 changed files with 378 additions and 16 deletions

View File

@@ -42,7 +42,7 @@ namespace OpenRA
for( int x = 0 ; x < map.MapSize.X ; x++ )
for( int y = 0 ; y < map.MapSize.Y ; y++ )
for (var umt = UnitMovementType.Foot; umt <= UnitMovementType.Fly; umt++ )
passableCost[(int)umt][ x, y ] = (umt == UnitMovementType.Fly) ? 0f : ( world.Map.IsInMap( x, y ) )
passableCost[(int)umt][ x, y ] = (umt == UnitMovementType.Fly) ? 1f : ( world.Map.IsInMap( x, y ) )
? (float)Rules.TerrainTypes[world.TileSet.GetTerrainType(world.Map.MapTiles[x, y])]
.GetCost(umt)
: float.PositiveInfinity;