Changeset - r8010:4b0a3a288fdf
[Not reviewed]
master
0 1 0
smatz - 17 years ago 2007-12-04 21:39:03
smatz@openttd.org
(svn r11570) -Fix: do not flood rail station tiles when there is a vehicle on it (when non-uniform stations are ON)
1 file changed with 13 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -1170,17 +1170,27 @@ CommandCost CmdRemoveFromRailroadStation
 

	
 
	/* Do the action for every tile into the area */
 
	BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) {
 
		/* Make sure the specified tile belongs to the current player, and that it is a railroad station. */
 
		if (!IsTileType(tile2, MP_STATION) || !IsRailwayStation(tile2) || !_patches.nonuniform_stations) {
 
		/* Make sure the specified tile is a railroad station */
 
		if (!IsTileType(tile2, MP_STATION) || !IsRailwayStation(tile2)) {
 
			continue;
 
		}
 

	
 
		/* If there is a vehicle on ground, do not allow to remove (flood) the tile */
 
		if (!EnsureNoVehicleOnGround(tile2)) {
 
			continue;
 
		}
 

	
 
		/* Check ownership of station */
 
		Station *st = GetStationByTile(tile2);
 
		if (_current_player != OWNER_WATER && (!CheckOwnership(st->owner) || !EnsureNoVehicleOnGround(tile2))) {
 
		if (_current_player != OWNER_WATER && !CheckOwnership(st->owner)) {
 
			continue;
 
		}
 

	
 
		/* Do not allow removing from stations if non-uniform stations are not enabled
 
		 * The check must be here to give correct error message
 
 		 */
 
		if (!_patches.nonuniform_stations) return_cmd_error(STR_306D_NONUNIFORM_STATIONS_DISALLOWED);
 

	
 
		/* If we reached here, the tile is valid so increase the quantity of tiles we will remove */
 
		quantity++;
 

	
0 comments (0 inline, 0 general)