diff options
author | smatz <smatz@openttd.org> | 2007-12-18 18:02:00 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2007-12-18 18:02:00 +0000 |
commit | 31765f0dfea216ab4d49f2ca9865b789e057b91a (patch) | |
tree | afb49510f3add6ead2de5ebbcefffec04fe5d996 /src | |
parent | 4bc3a244f513c407e8c82f94ee81d80609822a9a (diff) | |
download | openttd-31765f0dfea216ab4d49f2ca9865b789e057b91a.tar.xz |
(svn r11659) -Fix [FS#1563]: do not allow modifying non-uniform stations when non-uniform stations are disabled
Diffstat (limited to 'src')
-rw-r--r-- | src/station_cmd.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index dc077e27f..d8555037f 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -794,6 +794,15 @@ static bool CanExpandRailroadStation(const Station* st, uint* fin, Axis axis) 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; |