From 8cc43828e8cbc248e8b03cdad0381caa63725888 Mon Sep 17 00:00:00 2001 From: yexo Date: Mon, 6 Sep 2010 15:23:16 +0000 Subject: (svn r20754) -Fix [FS#4112]: assert when an industry previously build on water was flooded because it's grf changed/is missing --- src/industry_cmd.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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)) { -- cgit v1.2.3-54-g00ecf