From 2310cca635654c9e4c3ad3dac41c041193381e95 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 11 Apr 2019 13:34:55 +0200 Subject: openttd-git: commit new patches --- openttd-git/signaltunnel.patch | 34 ++++++++-------- openttd-git/sloped-stations.patch | 18 ++++----- openttd-git/underground.patch | 82 +++++++++++++++++++-------------------- 3 files changed, 68 insertions(+), 66 deletions(-) (limited to 'openttd-git') diff --git a/openttd-git/signaltunnel.patch b/openttd-git/signaltunnel.patch index fd2cdec0..fa2561fd 100644 --- a/openttd-git/signaltunnel.patch +++ b/openttd-git/signaltunnel.patch @@ -47,7 +47,7 @@ index 22476579be..02e4899594 100644 STR_LAI_BRIDGE_DESCRIPTION_RAIL_GIRDER_STEEL :Стальной балочный ж/д мост STR_LAI_BRIDGE_DESCRIPTION_RAIL_CANTILEVER_STEEL :Стальной консольный ж/д мост diff --git a/src/pathfinder/follow_track.hpp b/src/pathfinder/follow_track.hpp -index 2bbad8d70b..0d5f5bad7b 100644 +index 999f7f94de..728e252f94 100644 --- a/src/pathfinder/follow_track.hpp +++ b/src/pathfinder/follow_track.hpp @@ -360,7 +360,7 @@ protected: @@ -69,7 +69,7 @@ index 2bbad8d70b..0d5f5bad7b 100644 return false; } diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp -index 4257b5258f..e2226bc615 100644 +index d8327c4449..69dc63750c 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -1049,9 +1049,12 @@ CommandCost CmdBuildSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1, @@ -248,7 +248,7 @@ index 4257b5258f..e2226bc615 100644 + return CommandCost(EXPENSES_CONSTRUCTION, cost); + } + - Train *v = NULL; + Train *v = nullptr; if (HasReservedTracks(tile, TrackToTrackBits(track))) { v = GetTrainForReservation(tile, track); @@ -1502,7 +1586,7 @@ CommandCost CmdRemoveSingleSignal(TileIndex tile, DoCommandFlag flags, uint32 p1 @@ -261,10 +261,10 @@ index 4257b5258f..e2226bc615 100644 /** diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp -index c15f075ecf..afc35bd919 100644 +index 51b5340e39..5a62f40296 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp -@@ -1566,6 +1566,7 @@ static SettingsContainer &GetSettingsTree() +@@ -1554,6 +1554,7 @@ static SettingsContainer &GetSettingsTree() SettingsPage *construction = interface->Add(new SettingsPage(STR_CONFIG_SETTING_INTERFACE_CONSTRUCTION)); { construction->Add(new SettingEntry("gui.link_terraform_toolbar")); @@ -285,7 +285,7 @@ index 2459058979..8a1d0408af 100644 uint32 terraform_per_64k_frames; ///< how many tile heights may, over a long period, be terraformed per 65536 frames? uint16 terraform_frame_burst; ///< how many tile heights may, over a short period, be terraformed? diff --git a/src/signal.cpp b/src/signal.cpp -index b37e15074a..0de45a57c7 100644 +index 8952000a51..137e435fb3 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -197,6 +197,14 @@ static Vehicle *TrainOnTileEnum(Vehicle *v, void *) @@ -308,13 +308,13 @@ index b37e15074a..0de45a57c7 100644 DiagDirection dir = GetTunnelBridgeDirection(tile); - if (enterdir == INVALID_DIAGDIR) { // incoming from the wormhole -- if (!(flags & SF_TRAIN) && HasVehicleOnPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN; +- if (!(flags & SF_TRAIN) && HasVehicleOnPos(tile, nullptr, &TrainOnTileEnum)) flags |= SF_TRAIN; - enterdir = dir; - exitdir = ReverseDiagDir(dir); - tile += TileOffsByDiagDir(exitdir); // just skip to next tile - } else { // NOT incoming from the wormhole! - if (ReverseDiagDir(enterdir) != dir) continue; -- if (!(flags & SF_TRAIN) && HasVehicleOnPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN; +- if (!(flags & SF_TRAIN) && HasVehicleOnPos(tile, nullptr, &TrainOnTileEnum)) flags |= SF_TRAIN; - tile = GetOtherTunnelBridgeEnd(tile); // just skip to exit tile - enterdir = INVALID_DIAGDIR; - exitdir = INVALID_DIAGDIR; @@ -339,13 +339,13 @@ index b37e15074a..0de45a57c7 100644 + } + } else { + if (enterdir == INVALID_DIAGDIR) { // incoming from the wormhole -+ if (!(flags & SF_TRAIN) && HasVehicleOnPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN; ++ if (!(flags & SF_TRAIN) && HasVehicleOnPos(tile, nullptr, &TrainOnTileEnum)) flags |= SF_TRAIN; + enterdir = dir; + exitdir = ReverseDiagDir(dir); + tile += TileOffsByDiagDir(exitdir); // just skip to next tile + } else { // NOT incoming from the wormhole! + if (ReverseDiagDir(enterdir) != dir) continue; -+ if (!(flags & SF_TRAIN) && HasVehicleOnPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN; ++ if (!(flags & SF_TRAIN) && HasVehicleOnPos(tile, nullptr, &TrainOnTileEnum)) flags |= SF_TRAIN; + tile = GetOtherTunnelBridgeEnd(tile); // just skip to exit tile + enterdir = INVALID_DIAGDIR; + exitdir = INVALID_DIAGDIR; @@ -391,7 +391,7 @@ index 78ed234ce2..92fb11e426 100644 [SDT_NULL] length = 1 diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp -index 008d515576..8a23bb5ac3 100644 +index 71b34d6ba2..8ee34b5f00 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1851,6 +1851,17 @@ void ReverseTrainDirection(Train *v) @@ -663,7 +663,7 @@ index 008d515576..8a23bb5ac3 100644 /* Perform look-ahead on tunnel exit. */ if (v->IsFrontEngine()) { diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp -index 79011a3bd5..1cf9be1214 100644 +index 78586b1a2e..89f756d17b 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -30,6 +30,7 @@ @@ -847,15 +847,17 @@ index 79011a3bd5..1cf9be1214 100644 static TrackStatus GetTileTrackStatus_TunnelBridge(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side) { TransportType transport_type = GetTunnelBridgeTransportType(tile); -@@ -1909,7 +2036,7 @@ extern const TileTypeProcs _tile_type_tunnelbridge_procs = { - NULL, // add_accepted_cargo_proc +@@ -1909,8 +2036,8 @@ extern const TileTypeProcs _tile_type_tunnelbridge_procs = { + nullptr, // add_accepted_cargo_proc GetTileDesc_TunnelBridge, // get_tile_desc_proc GetTileTrackStatus_TunnelBridge, // get_tile_track_status_proc -- NULL, // click_tile_proc +- nullptr, // click_tile_proc +- nullptr, // animate_tile_proc + ClickTile_TunnelBridge, // click_tile_proc - NULL, // animate_tile_proc ++ nullptr, // animate_tile_proc TileLoop_TunnelBridge, // tile_loop_proc ChangeTileOwner_TunnelBridge, // change_tile_owner_proc + nullptr, // add_produced_cargo_proc diff --git a/src/tunnelbridge_map.h b/src/tunnelbridge_map.h index 0f7f17b3ac..57f338b8be 100644 --- a/src/tunnelbridge_map.h diff --git a/openttd-git/sloped-stations.patch b/openttd-git/sloped-stations.patch index c0dc0d33..efd536a1 100644 --- a/openttd-git/sloped-stations.patch +++ b/openttd-git/sloped-stations.patch @@ -1,5 +1,5 @@ diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp -index 4257b5258f..afe669fc3a 100644 +index d8327c4449..af261cbf2e 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -190,14 +190,6 @@ RailType AllocateRailType(RailTypeLabel label) @@ -18,7 +18,7 @@ index 4257b5258f..afe669fc3a 100644 * --------- * |\ /| diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp -index d9825c9bfa..15b804af8d 100644 +index e9edbf2549..fa60de4506 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -35,6 +35,7 @@ @@ -94,7 +94,7 @@ index 5251a53923..ce9ac81518 100644 + #endif /* ROAD_TYPE_H */ diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp -index 559b875479..0e09e34741 100644 +index 7086d151d0..3252327972 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1483,7 +1483,7 @@ again: @@ -107,7 +107,7 @@ index 559b875479..0e09e34741 100644 } } diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp -index 873be3be56..1c91f2a359 100644 +index acffe113dd..675385d777 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -55,6 +55,7 @@ @@ -149,7 +149,7 @@ index 873be3be56..1c91f2a359 100644 uint invalid_dirs = 5 << axis; const StationSpec *statspec = StationClass::Get(spec_class)->GetSpec(spec_index); - bool slope_cb = statspec != NULL && HasBit(statspec->callback_mask, CBM_STATION_SLOPE_CHECK); + bool slope_cb = statspec != nullptr && HasBit(statspec->callback_mask, CBM_STATION_SLOPE_CHECK); TILE_AREA_LOOP(tile_cur, tile_area) { - CommandCost ret = CheckBuildableTile(tile_cur, invalid_dirs, allowed_z, false); @@ -192,7 +192,7 @@ index 873be3be56..1c91f2a359 100644 + st = BaseStation::GetByTile(ti->tile); + statspec = st->speclist[GetCustomStationSpecIndex(ti->tile)].spec; + -+ if (statspec != NULL) { ++ if (statspec != nullptr) { + uint tile = GetStationGfx(ti->tile); + + relocation = GetCustomStationRelocation(statspec, st, ti->tile); @@ -203,13 +203,13 @@ index 873be3be56..1c91f2a359 100644 + } + + /* Ensure the chosen tile layout is valid for this custom station */ -+ if (statspec->renderdata != NULL) { ++ if (statspec->renderdata != nullptr) { + t = &statspec->renderdata[tile < statspec->tiles ? tile : (uint)GetRailStationAxis(ti->tile)]; + } + } + } + - if (layout == NULL && (t == NULL || t->seq == NULL)) t = GetStationTileLayout(GetStationType(ti->tile), gfx); + if (layout == nullptr && (t == nullptr || t->seq == nullptr)) t = GetStationTileLayout(GetStationType(ti->tile), gfx); /* don't show foundation for docks */ @@ -2887,10 +2914,10 @@ static void DrawTile_Station(TileInfo *ti) @@ -343,7 +343,7 @@ index a573269975..7db27ec181 100644 /** Tramway sprites */ static const SpriteID SPR_TRAMWAY_BASE = SPR_ROADSTOP_BASE + ROADSTOP_SPRITE_COUNT; diff --git a/src/table/station_land.h b/src/table/station_land.h -index 3327dab5dd..991c5d3bec 100644 +index b678297d90..2291ba6bd3 100644 --- a/src/table/station_land.h +++ b/src/table/station_land.h @@ -777,6 +777,62 @@ static const DrawTileSeqStruct _station_display_datas_waypoint_Y[] = { diff --git a/openttd-git/underground.patch b/openttd-git/underground.patch index dded4efc..fc381075 100644 --- a/openttd-git/underground.patch +++ b/openttd-git/underground.patch @@ -70,7 +70,7 @@ index 5496edc55a..c8c16a28b8 100644 +underground_gui.h +widgets/underground_widget.h diff --git a/src/base_station_base.h b/src/base_station_base.h -index 8af01f8a70..b5b07eaf32 100644 +index d7a67bd657..b48057b583 100644 --- a/src/base_station_base.h +++ b/src/base_station_base.h @@ -28,6 +28,13 @@ struct StationSpecList { @@ -97,7 +97,7 @@ index 8af01f8a70..b5b07eaf32 100644 CommandCost BeforeAddTile(TileIndex tile, StationRectMode mode); CommandCost BeforeAddRect(TileIndex tile, int w, int h, StationRectMode mode); diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp -index c4aeb3a52e..9639957f6a 100644 +index bfe5c66b3c..230fc9421a 100644 --- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -14,6 +14,7 @@ @@ -148,7 +148,7 @@ index c4aeb3a52e..9639957f6a 100644 } diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp -index 7a7d4827d8..fbe7fec405 100644 +index 2b74f1d000..f25aa2802c 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -27,6 +27,7 @@ @@ -168,7 +168,7 @@ index 7a7d4827d8..fbe7fec405 100644 _settings_game.game_creation.map_y = FindFirstBit(MapSizeY()); _switch_mode = SM_RESTARTGAME; diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp -index 53cc2d39ea..b43f99f5de 100644 +index 550a193d79..011fe186f9 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -18,6 +18,8 @@ @@ -344,7 +344,7 @@ index 7eeddb4078..39c3ed5107 100644 }; diff --git a/src/heightmap.cpp b/src/heightmap.cpp -index 17bdbbf610..6521cee6f9 100644 +index 4609dceeb9..86ee14cc56 100644 --- a/src/heightmap.cpp +++ b/src/heightmap.cpp @@ -16,6 +16,7 @@ @@ -366,7 +366,7 @@ index 17bdbbf610..6521cee6f9 100644 for (row = 0; (uint)row < height; row++) { for (col = 0; (uint)col < width; col++) { diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp -index c20b0a05bb..53e49c5d6f 100644 +index df9286308e..48b2f4dc10 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -14,6 +14,7 @@ @@ -387,7 +387,7 @@ index c20b0a05bb..53e49c5d6f 100644 } diff --git a/src/landscape.cpp b/src/landscape.cpp -index b36f5c8842..84dd03ba3f 100644 +index 66be73bd65..dced07599e 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -35,6 +35,7 @@ @@ -916,10 +916,10 @@ index 68bc4f9657..6b7b54485f 100644 STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Stotelės rūšis: {LTBLUE}{STRING} STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Stotelės tipas: {LTBLUE}{STRING} diff --git a/src/lang/luxembourgish.txt b/src/lang/luxembourgish.txt -index 1190cd30f3..75c5fbd896 100644 +index 30507953f4..e71eefd00e 100644 --- a/src/lang/luxembourgish.txt +++ b/src/lang/luxembourgish.txt -@@ -2597,7 +2597,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Tramschi +@@ -2598,7 +2598,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Tramschi STR_LAND_AREA_INFORMATION_RAIL_OWNER :{BLACK}Schinnebesëtzer: {LTBLUE}{STRING} STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY :{BLACK}Gemeng: {LTBLUE}{STRING} STR_LAND_AREA_INFORMATION_LOCAL_AUTHORITY_NONE :Keng @@ -1140,7 +1140,7 @@ index 82918400a8..1bebdb738e 100644 STR_LAND_AREA_INFORMATION_STATION_CLASS :{BLACK}Clase de estación: {LTBLUE}{STRING} STR_LAND_AREA_INFORMATION_STATION_TYPE :{BLACK}Tipo de estación: {LTBLUE}{STRING} diff --git a/src/lang/spanish_MX.txt b/src/lang/spanish_MX.txt -index 04eb6c7fdb..4051a1358a 100644 +index ca0b6f0785..3faba92366 100644 --- a/src/lang/spanish_MX.txt +++ b/src/lang/spanish_MX.txt @@ -2603,7 +2603,7 @@ STR_LAND_AREA_INFORMATION_TRAM_OWNER :{BLACK}Propieta @@ -1571,7 +1571,7 @@ index 0000000000..53eafdde63 + +#endif /* LAYER_TYPE_H */ diff --git a/src/main_gui.cpp b/src/main_gui.cpp -index 808484b0ea..7a5f06561e 100644 +index d4559c216e..d7b29c278b 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -33,6 +33,9 @@ @@ -1630,7 +1630,7 @@ index 808484b0ea..7a5f06561e 100644 } diff --git a/src/map.cpp b/src/map.cpp -index 85590c3e88..c00faa18c1 100644 +index 53e26ed73e..c45ac1b0ff 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -13,6 +13,7 @@ @@ -1641,7 +1641,7 @@ index 85590c3e88..c00faa18c1 100644 #include "string_func.h" #include "safeguards.h" -@@ -38,7 +39,7 @@ TileExtended *_me = NULL; ///< Extended Tiles of the map +@@ -38,7 +39,7 @@ TileExtended *_me = nullptr; ///< Extended Tiles of the map * @param size_x the width of the map along the NE/SW edge * @param size_y the 'height' of the map along the SE/NW edge */ @@ -1778,7 +1778,7 @@ index 3d09f26f26..251ea4990d 100644 _pause_mode = PM_UNPAUSED; _fast_forward = 0; diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp -index 4aeb81736b..d94c7439db 100644 +index 4c7557c36f..0e09284a9f 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -214,10 +214,11 @@ public: @@ -1797,7 +1797,7 @@ index 4aeb81736b..d94c7439db 100644 line_nr++; diff --git a/src/rail.h b/src/rail.h -index 004593ce7c..f01bb15d25 100644 +index 8bfc3f025b..bddf9ecdfb 100644 --- a/src/rail.h +++ b/src/rail.h @@ -160,7 +160,7 @@ public: @@ -1810,7 +1810,7 @@ index 004593ce7c..f01bb15d25 100644 CursorID rail_swne; ///< Cursor for building rail in X direction CursorID rail_ew; ///< Cursor for building rail in E-W direction diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp -index 4257b5258f..7c2f91ae02 100644 +index d8327c4449..ccdb86a52c 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -535,7 +535,7 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u @@ -1906,7 +1906,7 @@ index 4257b5258f..7c2f91ae02 100644 } diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp -index d9825c9bfa..f9d420c5d7 100644 +index e9edbf2549..b3270e7004 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -255,7 +255,7 @@ static CommandCost RemoveRoad(TileIndex tile, DoCommandFlag flags, RoadBits piec @@ -1917,7 +1917,7 @@ index d9825c9bfa..f9d420c5d7 100644 + cost.AddCost(_price[PR_CLEAR_ROAD] * 2 * UNDERGROUND_COST_MULTIPLIER(tile)); if (flags & DC_EXEC) { Company *c = Company::GetIfValid(GetRoadOwner(tile, rt)); - if (c != NULL) { + if (c != nullptr) { @@ -737,7 +737,7 @@ do_clear:; /* Count pieces */ CountBits(pieces); @@ -1937,7 +1937,7 @@ index d9825c9bfa..f9d420c5d7 100644 } diff --git a/src/saveload/map_sl.cpp b/src/saveload/map_sl.cpp -index 5402ecc0d2..deec8eef70 100644 +index 18c1351176..f72855041f 100644 --- a/src/saveload/map_sl.cpp +++ b/src/saveload/map_sl.cpp @@ -11,6 +11,7 @@ @@ -1998,7 +1998,7 @@ index fa584693af..99ef125e4d 100644 WID_CS_START_DATE_TEXT = ::WID_CS_START_DATE_TEXT, ///< Clickable start date value. WID_CS_START_DATE_UP = ::WID_CS_START_DATE_UP, ///< Increase start year (start later). diff --git a/src/settings.cpp b/src/settings.cpp -index 749050132d..b64bf2ecad 100644 +index b111f87282..c9bbca01c5 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -32,6 +32,7 @@ @@ -2031,7 +2031,7 @@ index 2459058979..923861f8c6 100644 byte oil_refinery_limit; ///< distance oil refineries allowed from map edge byte snow_line_height; ///< the configured snow line height diff --git a/src/station.cpp b/src/station.cpp -index 6f10806a4b..dddda62b40 100644 +index b211c6422e..a3560f2fd4 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -13,6 +13,7 @@ @@ -2127,7 +2127,7 @@ index 6f10806a4b..dddda62b40 100644 bool empty = this->AfterRemoveTile(st, ta.tile); if (ta.w != 1 || ta.h != 1) empty = empty || this->AfterRemoveTile(st, TILE_ADDXY(ta.tile, ta.w - 1, ta.h - 1)); diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp -index 873be3be56..d2814a8d21 100644 +index acffe113dd..566bd84fb2 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -13,6 +13,7 @@ @@ -2172,7 +2172,7 @@ index 873be3be56..d2814a8d21 100644 } + if (!layers) break; } - *st = (closest_station == INVALID_STATION) ? NULL : T::Get(closest_station); + *st = (closest_station == INVALID_STATION) ? nullptr : T::Get(closest_station); return CommandCost(); @@ -835,7 +839,7 @@ CommandCost CheckBuildableTile(TileIndex tile, uint invalid_dirs, int &allowed_z return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED); @@ -2218,7 +2218,7 @@ index 873be3be56..d2814a8d21 100644 -CommandCost FindJoiningBaseStation(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, T **st) +CommandCost FindJoiningBaseStation(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, T **st, bool layers=false) { - assert(*st == NULL); + assert(*st == nullptr); bool check_surrounding = true; @@ -1185,7 +1191,7 @@ CommandCost FindJoiningBaseStation(StationID existing_station, StationID station @@ -2250,7 +2250,7 @@ index 873be3be56..d2814a8d21 100644 + cost.AddCost((numtracks * _price[PR_BUILD_STATION_RAIL] + _price[PR_BUILD_STATION_RAIL_LENGTH]) * plat_len * UNDERGROUND_COST_MULTIPLIER(tile_org)); + cost.AddCost(numtracks * plat_len * RailBuildCost(rt) * UNDERGROUND_COST_MULTIPLIER(tile_org)); - Station *st = NULL; + Station *st = nullptr; ret = FindJoiningStation(est, station_to_join, adjacent, new_location, &st); @@ -1356,8 +1362,10 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 byte numtracks_orig; @@ -2337,7 +2337,7 @@ index 873be3be56..d2814a8d21 100644 AirportTileTableIterator iter(as->table[layout], tile); CommandCost cost = CheckFlatLandAirport(iter, flags); diff --git a/src/station_gui.cpp b/src/station_gui.cpp -index edd02d6aef..06bad070ee 100644 +index a3013c847f..6c8a6e6253 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -21,6 +21,7 @@ @@ -2383,7 +2383,7 @@ index edd02d6aef..06bad070ee 100644 } } @@ -2204,8 +2212,11 @@ static const T *FindStationsNearby(TileArea ta, bool distant_join) - if (distant_join && min(ta.w, ta.h) >= _settings_game.station.station_spread) return NULL; + if (distant_join && min(ta.w, ta.h) >= _settings_game.station.station_spread) return nullptr; uint max_dist = distant_join ? _settings_game.station.station_spread - min(ta.w, ta.h) : 1; - TileIndex tile = TileAddByDir(ctx.tile, DIR_N); @@ -2394,7 +2394,7 @@ index edd02d6aef..06bad070ee 100644 + CircularTileSearch(&tile, max_dist, ta.w, ta.h, AddNearbyStation, &ctx); + } - return NULL; + return nullptr; } diff --git a/src/table/settings.ini b/src/table/settings.ini index 78ed234ce2..745b62ba76 100644 @@ -2433,7 +2433,7 @@ index 78ed234ce2..745b62ba76 100644 [SDTC_BOOL] ifdef = DEDICATED diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp -index 9839f5e34b..faaf01b275 100644 +index eb6ec2b530..8dd16dce11 100644 --- a/src/terraform_cmd.cpp +++ b/src/terraform_cmd.cpp @@ -10,6 +10,7 @@ @@ -2456,7 +2456,7 @@ index 9839f5e34b..faaf01b275 100644 if (IsBridgeAbove(tile)) { int bridge_height = GetBridgeHeight(GetSouthernBridgeEnd(tile)); diff --git a/src/tgp.cpp b/src/tgp.cpp -index 4dbb79aa82..01e2609c6e 100644 +index 3fd42e0fdb..433dd7cb75 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -14,6 +14,7 @@ @@ -2502,7 +2502,7 @@ index 4dbb79aa82..01e2609c6e 100644 int max_height = H2I(TGPGetMaxHeight()); diff --git a/src/tile_map.h b/src/tile_map.h -index 7a76f2b974..96a1418395 100644 +index 0cb28122d8..c6f62dac0f 100644 --- a/src/tile_map.h +++ b/src/tile_map.h @@ -16,6 +16,7 @@ @@ -2558,7 +2558,7 @@ index 45bfb3d4c0..164781814b 100644 bool Contains(TileIndex tile) const; diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp -index 00d0bba0b0..f3c38af3f1 100644 +index bd7472ecdc..36fb30322b 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -13,7 +13,10 @@ @@ -2745,7 +2745,7 @@ index 00d0bba0b0..f3c38af3f1 100644 SPR_IMG_MESSAGES, // WID_TN_MESSAGES SPR_IMG_QUERY, // WID_TN_HELP diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp -index d918fbceda..d54d5d86f2 100644 +index 367eba45f9..fa2e6ab631 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -13,6 +13,7 @@ @@ -2776,7 +2776,7 @@ index d918fbceda..d54d5d86f2 100644 } return CommandCost(); diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp -index 7240cf86d3..824ec2c2f9 100644 +index e982abfb28..a8283b8da8 100644 --- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -13,6 +13,7 @@ @@ -2809,7 +2809,7 @@ index 7240cf86d3..824ec2c2f9 100644 if (tree_to_plant != TREE_INVALID && !IsInsideBS(tree_to_plant, _tree_base_by_landscape[_settings_game.game_creation.landscape], _tree_count_by_landscape[_settings_game.game_creation.landscape])) return CMD_ERROR; diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp -index 79011a3bd5..d5b2b4b746 100644 +index 78586b1a2e..f297a7bd59 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -15,6 +15,7 @@ @@ -3197,7 +3197,7 @@ index 0000000000..81b119545e + +#endif /* UNDERGROUND_GUI_H */ diff --git a/src/vehicle.cpp b/src/vehicle.cpp -index 856fc6737c..cda355815a 100644 +index e6df365b05..c27e1f681e 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -15,6 +15,7 @@ @@ -3211,13 +3211,13 @@ index 856fc6737c..cda355815a 100644 @@ -1143,6 +1144,7 @@ void ViewportAddVehicles(DrawPixelInfo *dpi) const Vehicle *v = _vehicle_viewport_hash[x + y]; // already masked & 0xFFF - while (v != NULL) { + while (v != nullptr) { + if (LayerIndex(v->tile) == dpi->layer) if (!(v->vehstatus & VS_HIDDEN) && l <= v->coord.right && t <= v->coord.bottom && diff --git a/src/viewport.cpp b/src/viewport.cpp -index 9bbe6a4623..803b76a714 100644 +index 804aa1cc6f..0a49dcdc0d 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -64,6 +64,8 @@ @@ -3285,7 +3285,7 @@ index 9bbe6a4623..803b76a714 100644 ViewportAddVehicles(&_vd.dpi); diff --git a/src/viewport_func.h b/src/viewport_func.h -index 319d4efd60..b87ba55574 100644 +index 49ad4b2e83..4d5b75987a 100644 --- a/src/viewport_func.h +++ b/src/viewport_func.h @@ -33,6 +33,7 @@ void MarkAllViewportsDirty(int left, int top, int right, int bottom); @@ -3297,7 +3297,7 @@ index 319d4efd60..b87ba55574 100644 void HandleZoomMessage(Window *w, const ViewPort *vp, byte widget_zoom_in, byte widget_zoom_out); diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp -index 936990ac5b..773360e3bc 100644 +index 85b278b2a7..8e03178ffc 100644 --- a/src/viewport_gui.cpp +++ b/src/viewport_gui.cpp @@ -16,6 +16,7 @@ @@ -3322,7 +3322,7 @@ index 936990ac5b..773360e3bc 100644 } diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp -index 03b321e686..ccdcb158b9 100644 +index e3247ec665..e112612576 100644 --- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -12,6 +12,7 @@ -- cgit v1.2.3-70-g09d2