Changeset - r8386:86c333e278d5
[Not reviewed]
master
0 2 0
peter1138 - 17 years ago 2008-01-23 08:47:49
peter1138@openttd.org
(svn r11956) -Fix [FS#1675]: Disallow building locks and docks on rapids.
2 files changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -1951,12 +1951,15 @@ CommandCost CmdBuildDock(TileIndex tile,
 
		case SLOPE_SE: direction = DIAGDIR_NW; break;
 
		case SLOPE_NW: direction = DIAGDIR_SE; break;
 
		case SLOPE_NE: direction = DIAGDIR_SW; break;
 
		default: return_cmd_error(STR_304B_SITE_UNSUITABLE);
 
	}
 

	
 
	/* Docks cannot be placed on rapids */
 
	if (IsRiverTile(tile)) return_cmd_error(STR_304B_SITE_UNSUITABLE);
 

	
 
	if (!(flags & DC_NO_TOWN_RATING) && !CheckIfAuthorityAllows(tile)) return CMD_ERROR;
 

	
 
	if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
 

	
 
	cost = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
	if (CmdFailed(cost)) return CMD_ERROR;
src/water_cmd.cpp
Show inline comments
 
@@ -282,12 +282,16 @@ CommandCost CmdBuildLock(TileIndex tile,
 
		case SLOPE_SW: dir = DIAGDIR_SW; break;
 
		case SLOPE_SE: dir = DIAGDIR_SE; break;
 
		case SLOPE_NW: dir = DIAGDIR_NW; break;
 
		case SLOPE_NE: dir = DIAGDIR_NE; break;
 
		default: return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
 
	}
 

	
 
	/* Disallow building of locks on river rapids */
 
	if (IsRiverTile(tile)) return_cmd_error(STR_0239_SITE_UNSUITABLE);
 

	
 
	return DoBuildShiplift(tile, dir, flags);
 
}
 

	
 
/** Build a piece of canal.
 
 * @param tile end tile of stretch-dragging
 
 * @param flags type of operation
0 comments (0 inline, 0 general)