diff options
author | yexo <yexo@openttd.org> | 2010-09-06 15:23:16 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-09-06 15:23:16 +0000 |
commit | 8cc43828e8cbc248e8b03cdad0381caa63725888 (patch) | |
tree | 7086a919a7839c5d983f41d000ec26e90fa04f04 | |
parent | fd54943c7a0dfa421eaa403b1cd18f06ccc4c6b9 (diff) | |
download | openttd-8cc43828e8cbc248e8b03cdad0381caa63725888.tar.xz |
(svn r20754) -Fix [FS#4112]: assert when an industry previously build on water was flooded because it's grf changed/is missing
-rw-r--r-- | src/industry_cmd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index c9852472c..30c6503c8 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -785,6 +785,12 @@ static void TileLoop_Industry(TileIndex tile) { if (IsTileOnWater(tile)) TileLoop_Water(tile); + /* Normally this doesn't happen, but if an industry NewGRF is removed + * an industry that was previously build on water can now be flooded. + * If this happens the tile is no longer an industry tile after + * returning from TileLoop_Water. */ + if (!IsTileType(tile, MP_INDUSTRY)) return; + TriggerIndustryTile(tile, INDTILE_TRIGGER_TILE_LOOP); if (!IsIndustryCompleted(tile)) { |