(svn r3416) - Fix: Disallow building an oil rig above sea level.
authorpeter1138
Sun, 22 Jan 2006 09:52:20 +0000
changeset 2868 9678db2d90e8
parent 2867 91ee491df4ec
child 2869 c5ed60d34909
(svn r3416) - Fix: Disallow building an oil rig above sea level.
industry_cmd.c
--- a/industry_cmd.c	Sat Jan 21 22:09:25 2006 +0000
+++ b/industry_cmd.c	Sun Jan 22 09:52:20 2006 +0000
@@ -1170,7 +1170,8 @@
 {
 	if (_game_mode == GM_EDITOR && _ignore_restrictions) return true;
 	if (_game_mode == GM_EDITOR && type != IT_OIL_RIG)   return true;
-	if (DistanceFromEdge(TILE_ADDXY(tile, 1, 1)) < 16)   return true;
+	if ((type != IT_OIL_RIG || TileHeight(tile) == 0) &&
+			DistanceFromEdge(TILE_ADDXY(tile, 1, 1)) < 16)   return true;
 
 	_error_message = STR_483B_CAN_ONLY_BE_POSITIONED;
 	return false;