From fd5f6caed48e36b9d11095899fa6f8f16063ec76 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Tue, 31 Dec 2024 22:44:12 +0100 Subject: [PATCH] Codechange: use explicit TileIndex constructor for tile 0 --- src/aircraft_cmd.cpp | 4 +-- src/group_gui.cpp | 2 +- src/industry_gui.cpp | 2 +- src/landscape.cpp | 2 +- src/map_func.h | 2 +- src/order_backup.cpp | 2 +- src/order_cmd.cpp | 8 ++--- src/roadveh_cmd.cpp | 2 +- src/saveload/industry_sl.cpp | 2 +- src/saveload/map_sl.cpp | 42 +++++++++++++------------- src/saveload/oldloader_sl.cpp | 4 +-- src/saveload/station_sl.cpp | 2 +- src/saveload/storage_sl.cpp | 2 +- src/script/api/script_industrytype.cpp | 2 +- src/script/api/script_story_page.cpp | 4 +-- src/ship_cmd.cpp | 2 +- src/station_cmd.cpp | 4 +-- src/story_gui.cpp | 4 +-- src/train_cmd.cpp | 2 +- src/vehicle_gui.cpp | 2 +- 20 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 1b8ed4e7af..9fcc7ab5f2 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -831,7 +831,7 @@ static uint8_t AircraftGetEntryPoint(const Aircraft *v, const AirportFTAClass *a /* In the case the station doesn't exit anymore, set target tile 0. * It doesn't hurt much, aircraft will go to next order, nearest hangar * or it will simply crash in next tick */ - TileIndex tile = 0; + TileIndex tile{}; const Station *st = Station::GetIfValid(v->targetairport); if (st != nullptr) { @@ -1305,7 +1305,7 @@ TileIndex Aircraft::GetOrderStationLocation(StationID) } /* Aircraft do not use dest-tile */ - return 0; + return TileIndex{}; } void Aircraft::MarkDirty() diff --git a/src/group_gui.cpp b/src/group_gui.cpp index cc24010cf2..e7446b043d 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -861,7 +861,7 @@ public: case WID_GL_START_ALL: case WID_GL_STOP_ALL: { // Start/stop all vehicles of the list - Command::Post(0, widget == WID_GL_START_ALL, true, this->vli); + Command::Post(TileIndex{}, widget == WID_GL_START_ALL, true, this->vli); break; } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index d6c8aeea24..8c1106c9ea 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -682,7 +682,7 @@ public: case WID_DPI_FUND_WIDGET: { if (this->selected_type != INVALID_INDUSTRYTYPE) { if (_game_mode != GM_EDITOR && _settings_game.construction.raw_industry_construction == 2 && GetIndustrySpec(this->selected_type)->IsRawIndustry()) { - Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, 0, this->selected_type, 0, false, InteractiveRandom()); + Command::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, TileIndex{}, this->selected_type, 0, false, InteractiveRandom()); this->HandleButtonClick(WID_DPI_FUND_WIDGET); } else { HandlePlacePushButton(this, WID_DPI_FUND_WIDGET, SPR_CURSOR_INDUSTRY, HT_RECT); diff --git a/src/landscape.cpp b/src/landscape.cpp index b6ca983d87..fea143101c 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -792,7 +792,7 @@ void RunTileLoop() /* Manually update tile 0 every TILE_UPDATE_FREQUENCY ticks - the LFSR never iterates over it itself. */ if (TimerGameTick::counter % TILE_UPDATE_FREQUENCY == 0) { - _tile_type_procs[GetTileType(0)]->tile_loop_proc(0); + _tile_type_procs[GetTileType(0)]->tile_loop_proc(TileIndex{}); count--; } diff --git a/src/map_func.h b/src/map_func.h index 3d0331be63..4daa35901f 100644 --- a/src/map_func.h +++ b/src/map_func.h @@ -228,7 +228,7 @@ private: * Iterable ensemble of all Tiles */ struct IterateWrapper { - Iterator begin() { return Iterator(0); } + Iterator begin() { return Iterator(TileIndex{}); } Iterator end() { return Iterator(Map::Size()); } bool empty() { return false; } }; diff --git a/src/order_backup.cpp b/src/order_backup.cpp index f696d8435d..8a6079c176 100644 --- a/src/order_backup.cpp +++ b/src/order_backup.cpp @@ -173,7 +173,7 @@ CommandCost CmdClearOrderBackup(DoCommandFlag flags, TileIndex tile, ClientID us /* If it's not a backup of us, ignore it. */ if (ob->user != user) continue; - Command::Post(0, static_cast(user)); + Command::Post(TileIndex{}, static_cast(user)); return; } } diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 61bd5e17b9..514cc3a895 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -1999,7 +1999,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool { if (conditional_depth > v->GetNumOrders()) { v->current_order.Free(); - v->SetDestTile(0); + v->SetDestTile(TileIndex{}); return false; } @@ -2093,7 +2093,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool } default: - v->SetDestTile(0); + v->SetDestTile(TileIndex{}); return false; } @@ -2109,7 +2109,7 @@ bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool if (order == nullptr) { v->current_order.Free(); - v->SetDestTile(0); + v->SetDestTile(TileIndex{}); return false; } @@ -2184,7 +2184,7 @@ bool ProcessOrders(Vehicle *v) } v->current_order.Free(); - v->SetDestTile(0); + v->SetDestTile(TileIndex{}); return false; } diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 528b849c73..b54c0f9d7f 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -588,7 +588,7 @@ TileIndex RoadVehicle::GetOrderStationLocation(StationID station) if (!CanVehicleUseStation(this, st)) { /* There is no stop left at the station, so don't even TRY to go there */ this->IncrementRealOrderIndex(); - return 0; + return TileIndex{}; } return st->xy; diff --git a/src/saveload/industry_sl.cpp b/src/saveload/industry_sl.cpp index 5d843ec349..73479ce2a0 100644 --- a/src/saveload/industry_sl.cpp +++ b/src/saveload/industry_sl.cpp @@ -220,7 +220,7 @@ struct INDYChunkHandler : ChunkHandler { if (IsSavegameVersionBefore(SLV_161) && !IsSavegameVersionBefore(SLV_76)) { /* Store the old persistent storage. The GRFID will be added later. */ assert(PersistentStorage::CanAllocateItem()); - i->psa = new PersistentStorage(0, 0, 0); + i->psa = new PersistentStorage(0, 0, TileIndex{}); std::copy(std::begin(_old_ind_persistent_storage.storage), std::end(_old_ind_persistent_storage.storage), std::begin(i->psa->storage)); } if (IsSavegameVersionBefore(SLV_EXTEND_INDUSTRY_CARGO_SLOTS)) { diff --git a/src/saveload/map_sl.cpp b/src/saveload/map_sl.cpp index 3ce23a42b2..c96a76075d 100644 --- a/src/saveload/map_sl.cpp +++ b/src/saveload/map_sl.cpp @@ -74,7 +74,7 @@ struct MAPTChunkHandler : ChunkHandler { std::array buf; uint size = Map::Size(); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) Tile(i++).type() = buf[j]; } @@ -86,7 +86,7 @@ struct MAPTChunkHandler : ChunkHandler { uint size = Map::Size(); SlSetLength(size); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = Tile(i++).type(); SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); } @@ -101,7 +101,7 @@ struct MAPHChunkHandler : ChunkHandler { std::array buf; uint size = Map::Size(); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) Tile(i++).height() = buf[j]; } @@ -113,7 +113,7 @@ struct MAPHChunkHandler : ChunkHandler { uint size = Map::Size(); SlSetLength(size); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = Tile(i++).height(); SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); } @@ -128,7 +128,7 @@ struct MAPOChunkHandler : ChunkHandler { std::array buf; uint size = Map::Size(); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) Tile(i++).m1() = buf[j]; } @@ -140,7 +140,7 @@ struct MAPOChunkHandler : ChunkHandler { uint size = Map::Size(); SlSetLength(size); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = Tile(i++).m1(); SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); } @@ -155,7 +155,7 @@ struct MAP2ChunkHandler : ChunkHandler { std::array buf; uint size = Map::Size(); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { SlCopy(buf.data(), MAP_SL_BUF_SIZE, /* In those versions the m2 was 8 bits */ IsSavegameVersionBefore(SLV_5) ? SLE_FILE_U8 | SLE_VAR_U16 : SLE_UINT16 @@ -170,7 +170,7 @@ struct MAP2ChunkHandler : ChunkHandler { uint size = Map::Size(); SlSetLength(static_cast(size) * sizeof(uint16_t)); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = Tile(i++).m2(); SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT16); } @@ -185,7 +185,7 @@ struct M3LOChunkHandler : ChunkHandler { std::array buf; uint size = Map::Size(); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) Tile(i++).m3() = buf[j]; } @@ -197,7 +197,7 @@ struct M3LOChunkHandler : ChunkHandler { uint size = Map::Size(); SlSetLength(size); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = Tile(i++).m3(); SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); } @@ -212,7 +212,7 @@ struct M3HIChunkHandler : ChunkHandler { std::array buf; uint size = Map::Size(); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) Tile(i++).m4() = buf[j]; } @@ -224,7 +224,7 @@ struct M3HIChunkHandler : ChunkHandler { uint size = Map::Size(); SlSetLength(size); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = Tile(i++).m4(); SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); } @@ -239,7 +239,7 @@ struct MAP5ChunkHandler : ChunkHandler { std::array buf; uint size = Map::Size(); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) Tile(i++).m5() = buf[j]; } @@ -251,7 +251,7 @@ struct MAP5ChunkHandler : ChunkHandler { uint size = Map::Size(); SlSetLength(size); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = Tile(i++).m5(); SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); } @@ -267,7 +267,7 @@ struct MAPEChunkHandler : ChunkHandler { uint size = Map::Size(); if (IsSavegameVersionBefore(SLV_42)) { - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { /* 1024, otherwise we overflow on 64x64 maps! */ SlCopy(buf.data(), 1024, SLE_UINT8); for (uint j = 0; j != 1024; j++) { @@ -278,7 +278,7 @@ struct MAPEChunkHandler : ChunkHandler { } } } else { - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) Tile(i++).m6() = buf[j]; } @@ -291,7 +291,7 @@ struct MAPEChunkHandler : ChunkHandler { uint size = Map::Size(); SlSetLength(size); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = Tile(i++).m6(); SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); } @@ -306,7 +306,7 @@ struct MAP7ChunkHandler : ChunkHandler { std::array buf; uint size = Map::Size(); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) Tile(i++).m7() = buf[j]; } @@ -318,7 +318,7 @@ struct MAP7ChunkHandler : ChunkHandler { uint size = Map::Size(); SlSetLength(size); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = Tile(i++).m7(); SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT8); } @@ -333,7 +333,7 @@ struct MAP8ChunkHandler : ChunkHandler { std::array buf; uint size = Map::Size(); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT16); for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) Tile(i++).m8() = buf[j]; } @@ -345,7 +345,7 @@ struct MAP8ChunkHandler : ChunkHandler { uint size = Map::Size(); SlSetLength(static_cast(size) * sizeof(uint16_t)); - for (TileIndex i = 0; i != size;) { + for (TileIndex i{}; i != size;) { for (uint j = 0; j != MAP_SL_BUF_SIZE; j++) buf[j] = Tile(i++).m8(); SlCopy(buf.data(), MAP_SL_BUF_SIZE, SLE_UINT16); } diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp index 436c309b3a..064f53d5fa 100644 --- a/src/saveload/oldloader_sl.cpp +++ b/src/saveload/oldloader_sl.cpp @@ -538,7 +538,7 @@ static void ReadTTDPatchFlags() _bump_assert_value = (_old_vehicle_multiplier - 1) * 850 * 128; /* The first 17 bytes are used by TTDP1, which translates to the first 9 m3s and first 8 m4s. */ - for (TileIndex i = 0; i <= 8; i++) { // check tile 0, too + for (TileIndex i{}; i <= 8; i++) { // check tile 0, too Tile tile(i); if (tile.m3() != 0 || (i != 8 && tile.m4() != 0)) _savegame_type = SGT_TTDP1; } @@ -555,7 +555,7 @@ static void ReadTTDPatchFlags() _old_extra_chunk_nums = extra_chunk_tile.m3() | extra_chunk_tile.m4() << 8; /* Clean the misused places */ - for (TileIndex i = 0; i < 9; i++) ClearOldMap3(i); + for (TileIndex i{}; i < 9; i++) ClearOldMap3(i); for (TileIndex i = TileXY(0, Map::MaxY()); i < Map::Size(); i++) ClearOldMap3(i); if (_savegame_type == SGT_TTDP2) Debug(oldloader, 2, "Found TTDPatch game"); diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index c9932cae6f..26c794d858 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -380,7 +380,7 @@ public: if (IsSavegameVersionBefore(SLV_161) && !IsSavegameVersionBefore(SLV_145) && st->facilities & FACIL_AIRPORT) { /* Store the old persistent storage. The GRFID will be added later. */ assert(PersistentStorage::CanAllocateItem()); - st->airport.psa = new PersistentStorage(0, 0, 0); + st->airport.psa = new PersistentStorage(0, 0, TileIndex{}); std::copy(std::begin(_old_st_persistent_storage.storage), std::end(_old_st_persistent_storage.storage), std::begin(st->airport.psa->storage)); } diff --git a/src/saveload/storage_sl.cpp b/src/saveload/storage_sl.cpp index 4db185e9af..772ef76989 100644 --- a/src/saveload/storage_sl.cpp +++ b/src/saveload/storage_sl.cpp @@ -35,7 +35,7 @@ struct PSACChunkHandler : ChunkHandler { while ((index = SlIterateArray()) != -1) { assert(PersistentStorage::CanAllocateItem()); - PersistentStorage *ps = new (index) PersistentStorage(0, 0, 0); + PersistentStorage *ps = new (index) PersistentStorage(0, 0, TileIndex{}); SlObject(ps, slt); } } diff --git a/src/script/api/script_industrytype.cpp b/src/script/api/script_industrytype.cpp index 64ccd1260c..0fa28c00c3 100644 --- a/src/script/api/script_industrytype.cpp +++ b/src/script/api/script_industrytype.cpp @@ -134,7 +134,7 @@ EnforcePrecondition(false, CanProspectIndustry(industry_type)); uint32_t seed = ScriptBase::Rand(); - return ScriptObject::Command::Do(0, industry_type, 0, false, seed); + return ScriptObject::Command::Do(TileIndex{}, industry_type, 0, false, seed); } /* static */ bool ScriptIndustryType::IsBuiltOnWater(IndustryType industry_type) diff --git a/src/script/api/script_story_page.cpp b/src/script/api/script_story_page.cpp index d1cd5004b0..2471d35745 100644 --- a/src/script/api/script_story_page.cpp +++ b/src/script/api/script_story_page.cpp @@ -80,7 +80,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(STORY_PAGE_ELEMENT_INVALID, type != SPET_GOAL || !(StoryPage::Get(story_page_id)->company == INVALID_COMPANY && Goal::Get(reference)->company != INVALID_COMPANY)); uint32_t refid = 0; - TileIndex reftile = 0; + TileIndex reftile{}; switch (type) { case SPET_LOCATION: reftile = reference; @@ -129,7 +129,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type) EnforcePrecondition(false, type != ::SPET_GOAL || !(p->company == INVALID_COMPANY && Goal::Get(reference)->company != INVALID_COMPANY)); uint32_t refid = 0; - TileIndex reftile = 0; + TileIndex reftile{}; switch (type) { case ::SPET_LOCATION: reftile = reference; diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 9007b8b3a6..b4ac67cb08 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -324,7 +324,7 @@ TileIndex Ship::GetOrderStationLocation(StationID station) return st->xy; } else { this->IncrementRealOrderIndex(); - return 0; + return TileIndex{}; } } diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index d525b0ad79..de9801af76 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1838,7 +1838,7 @@ static CommandCost RemoveRailStation(TileIndex tile, DoCommandFlag flags) { /* if there is flooding, remove platforms tile by tile */ if (_current_company == OWNER_WATER) { - return Command::Do(DC_EXEC, tile, 0, false); + return Command::Do(DC_EXEC, tile, TileIndex{}, false); } Station *st = Station::GetByTile(tile); @@ -1859,7 +1859,7 @@ static CommandCost RemoveRailWaypoint(TileIndex tile, DoCommandFlag flags) { /* if there is flooding, remove waypoints tile by tile */ if (_current_company == OWNER_WATER) { - return Command::Do(DC_EXEC, tile, 0, false); + return Command::Do(DC_EXEC, tile, TileIndex{}, false); } return RemoveRailStation(Waypoint::GetByTile(tile), flags, _price[PR_CLEAR_WAYPOINT_RAIL]); diff --git a/src/story_gui.cpp b/src/story_gui.cpp index fe9d928eb2..757512cff2 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -557,7 +557,7 @@ protected: this->SetTimeout(); this->SetWidgetDirty(WID_SB_PAGE_PANEL); - Command::Post(0, pe.index, 0); + Command::Post(TileIndex{}, pe.index, 0); break; case SPET_BUTTON_TILE: @@ -925,7 +925,7 @@ public: VehicleType wanted_vehtype = data.GetVehicleType(); if (wanted_vehtype != VEH_INVALID && wanted_vehtype != v->type) return false; - Command::Post(0, pe->index, v->index); + Command::Post(TileIndex{}, pe->index, v->index); ResetObjectToPlace(); return true; } diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 267ceab29e..1f97ef21af 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2956,7 +2956,7 @@ TileIndex Train::GetOrderStationLocation(StationID station) if (!(st->facilities & FACIL_TRAIN)) { /* The destination station has no trainstation tiles. */ this->IncrementRealOrderIndex(); - return 0; + return TileIndex{}; } return st->xy; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 4504321b8f..e8d60d6649 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2217,7 +2217,7 @@ public: case WID_VL_STOP_ALL: case WID_VL_START_ALL: - Command::Post(0, widget == WID_VL_START_ALL, true, this->vli); + Command::Post(TileIndex{}, widget == WID_VL_START_ALL, true, this->vli); break; } }