oh ffs. old world was being referenced. fixed so it crashes if you do that.

This commit is contained in:
Chris Forbes
2010-01-19 11:21:45 +13:00
parent e82a398091
commit 00abdce68f
5 changed files with 16 additions and 10 deletions

View File

@@ -39,7 +39,12 @@ namespace OpenRa
var p = queue.Pop();
cellInfo[ p.Location.X, p.Location.Y ].Seen = true;
if (passableCost[(int)umt][p.Location.X, p.Location.Y] == float.PositiveInfinity)
var custom2 = Game.world.customTerrain[p.Location.X, p.Location.Y];
var thisCost = (custom2 != null)
? custom2.GetCost(p.Location, umt)
: passableCost[(int)umt][p.Location.X, p.Location.Y];
if (thisCost == float.PositiveInfinity)
return p.Location;
foreach( int2 d in Util.directions )
@@ -51,6 +56,7 @@ namespace OpenRa
continue;
var custom = Game.world.customTerrain[newHere.X, newHere.Y];
if (custom != null) throw new NotImplementedException();
var costHere = (custom != null) ? custom.GetCost(newHere, umt) : passableCost[(int)umt][newHere.X, newHere.Y];
if (costHere == float.PositiveInfinity)