Loading

Revision differences

Old revision #puyaz0353New revision #p9qop9062
1--- C:/Users/Ricardo/AppData/Local/Temp/water_cmd.cpp-revBASE.svn000.tmp.cpp    dom Set 21 12:24:51 2014  1--- C:/Users/Ricardo/AppData/Local/Temp/water_cmd.cpp-revBASE.svn001.tmp.cpp    dom Set 21 12:24:51 2014
2+++ C:/OpenTTD/trunk/src/water_cmd.cpp    seg Fev 16 16:56:09 2015  2+++ C:/OpenTTD/trunk/src/water_cmd.cpp    seg Fev 16 19:47:21 2015
3@@ -258,10 +258,14 @@ static CommandCost DoBuildLock(TileIndex tile, Dia  3@@ -258,10 +258,14 @@ static CommandCost DoBuildLock(TileIndex tile, Dia  
4   4   
5     /* middle tile */  5     /* middle tile */  
  
26             if (!IsWaterTile(tile + delta)) c->infrastructure.water++;  26             if (!IsWaterTile(tile + delta)) c->infrastructure.water++;  
27             /* Count for the lock itself. */  27             /* Count for the lock itself. */  
28             c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock is three tiles.  28             c->infrastructure.water += 3 * LOCK_DEPOT_TILE_FACTOR; // Lock is three tiles.  
29@@ -348,6 +353,7 @@ static CommandCost RemoveLock(TileIndex tile, DoCo  29@@ -348,6 +353,9 @@ static CommandCost RemoveLock(TileIndex tile, DoCo
30         if (GetWaterClass(tile) == WATER_CLASS_RIVER) {  30         if (GetWaterClass(tile) == WATER_CLASS_RIVER) {  
31             MakeRiver(tile, Random());  31             MakeRiver(tile, Random());  
32         } else {  32         } else {  
33+            c->infrastructure.water--;  33+            if (c != NULL) {
   34+                c->infrastructure.water--;
   35+            }
34             DoClearSquare(tile);  36             DoClearSquare(tile);  
35         }  37         }  
36         MakeWaterKeepingClass(tile + delta, GetTileOwner(tile + delta)); 38         MakeWaterKeepingClass(tile + delta, GetTileOwner(tile + delta));