src/station_cmd.cpp
changeset 8098 e42d1a10cda9
parent 8096 bc9bc6c35b9b
child 8102 906a3d3b6df1
--- a/src/station_cmd.cpp	Mon Dec 17 23:30:25 2007 +0000
+++ b/src/station_cmd.cpp	Tue Dec 18 18:02:00 2007 +0000
@@ -794,6 +794,15 @@
 		curh = max(TileY(st->train_tile) + curh, TileY(tile) + h) - y;
 		tile = TileXY(x, y);
 	} else {
+		/* do not allow modifying non-uniform stations,
+		 * the uniform-stations code wouldn't handle it well */
+		BEGIN_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
+			if (!st->TileBelongsToRailStation(t)) { // there may be adjoined station
+				_error_message = STR_306D_NONUNIFORM_STATIONS_DISALLOWED;
+				return false;
+			}
+		END_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
+
 		/* check so the orientation is the same */
 		if (GetRailStationAxis(st->train_tile) != axis) {
 			_error_message = STR_306D_NONUNIFORM_STATIONS_DISALLOWED;