src/station_cmd.cpp
changeset 8594 dfd42ca57d74
parent 8592 3b75a1a7ecd2
child 8598 14ae80fe4c8f
equal deleted inserted replaced
8593:ff04e6e4c7f3 8594:dfd42ca57d74
   792 		int y = min(TileY(st->train_tile), TileY(tile));
   792 		int y = min(TileY(st->train_tile), TileY(tile));
   793 		curw = max(TileX(st->train_tile) + curw, TileX(tile) + w) - x;
   793 		curw = max(TileX(st->train_tile) + curw, TileX(tile) + w) - x;
   794 		curh = max(TileY(st->train_tile) + curh, TileY(tile) + h) - y;
   794 		curh = max(TileY(st->train_tile) + curh, TileY(tile) + h) - y;
   795 		tile = TileXY(x, y);
   795 		tile = TileXY(x, y);
   796 	} else {
   796 	} else {
       
   797 		/* do not allow modifying non-uniform stations,
       
   798 		 * the uniform-stations code wouldn't handle it well */
       
   799 		BEGIN_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
       
   800 			if (!st->TileBelongsToRailStation(t)) { // there may be adjoined station
       
   801 				_error_message = STR_306D_NONUNIFORM_STATIONS_DISALLOWED;
       
   802 				return false;
       
   803 			}
       
   804 		END_TILE_LOOP(t, st->trainst_w, st->trainst_h, st->train_tile)
       
   805 
   797 		/* check so the orientation is the same */
   806 		/* check so the orientation is the same */
   798 		if (GetRailStationAxis(st->train_tile) != axis) {
   807 		if (GetRailStationAxis(st->train_tile) != axis) {
   799 			_error_message = STR_306D_NONUNIFORM_STATIONS_DISALLOWED;
   808 			_error_message = STR_306D_NONUNIFORM_STATIONS_DISALLOWED;
   800 			return false;
   809 			return false;
   801 		}
   810 		}