(svn r9574) -Fix(r9520, FS#721): Oil Rig ( or industry with behaviour INDUSTRYBEH_BUILT_ONWATER) should check all tiles before leaving the test. A tile in water does not ensure that all required tiles will necessary be on water.
authorbelugas
Sun, 08 Apr 2007 00:29:12 +0000
changeset 6438 e7b2ce9a3d3e
parent 6437 37959741e252
child 6439 e6b352b4281a
(svn r9574) -Fix(r9520, FS#721): Oil Rig ( or industry with behaviour INDUSTRYBEH_BUILT_ONWATER) should check all tiles before leaving the test. A tile in water does not ensure that all required tiles will necessary be on water.
src/industry_cmd.cpp
--- a/src/industry_cmd.cpp	Sat Apr 07 22:30:10 2007 +0000
+++ b/src/industry_cmd.cpp	Sun Apr 08 00:29:12 2007 +0000
@@ -1161,7 +1161,10 @@
 			IndustyBehaviour ind_behav = GetIndustrySpec(type)->behaviour;
 
 			if (ind_behav & INDUSTRYBEH_BUILT_ONWATER) {
-				return IsClearWaterTile(cur_tile);
+				/* As soon as the tile is not water, bail out.
+				 * But that does not mean the search is over.  You have
+				 * to make sure every tile of the industry will be only water*/
+				if (!IsClearWaterTile(cur_tile)) return false;
 			} else {
 				Slope tileh;