From a48f491f09145b2f99ed9d876657cacb5d3365de Mon Sep 17 00:00:00 2001 From: Susan Date: Fri, 11 Jul 2025 07:54:29 +0100 Subject: [PATCH] Cleanup: CodeQL fixes --- src/station_cmd.cpp | 7 +++---- src/tunnelbridge_cmd.cpp | 4 ---- src/waypoint_cmd.cpp | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 708f3b0d8d..56d84cf279 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1405,7 +1405,7 @@ static CommandCost CheckFlatLandRoadStop(TileIndex cur_tile, int &allowed_z, con (!_settings_game.construction.road_stop_on_competitor_road || /* Disallow breaking end-of-line of someone else * so trams can still reverse on this tile. */ - HasExactlyOneBit(GetRoadBits(cur_tile, RTT_TRAM)))) { + HasExactlyOneBit(GetRoadBits(cur_tile, RTT_TRAM)))) { ret = CheckOwnership(tram_owner); if (ret.Failed()) return ret; } @@ -1492,7 +1492,6 @@ CommandCost CmdBuildRailStation(DoCommandFlags flags, TileIndex tile_org, RailTy TileIndexDiff track_delta = TileOffsByAxis(OtherAxis(axis)); // offset to go to the next track std::vector layout_buffer; layout_buffer.resize(numtracks * plat_len); - //TempBufferST layout_buffer(numtracks * plat_len); GetStationLayout(&layout_buffer[0], numtracks, plat_len, statspec); { @@ -1501,9 +1500,9 @@ CommandCost CmdBuildRailStation(DoCommandFlags flags, TileIndex tile_org, RailTy for (uint i = 0; i < numtracks; i++) { TileIndex tile = tile_track; for (uint j = 0; j < plat_len; j++) { - CommandCost ret = IsRailStationBridgeAboveOk(tile, statspec, *check_layout_ptr++); + ret = IsRailStationBridgeAboveOk(tile, statspec, *check_layout_ptr++); if (ret.Failed()) { - //return CommandCost::DualErrorMessage(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST, ret.GetErrorMessage()); + //return CommandCost::DualErrorMessage(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST, ret.GetErrorMessage()); //FIXME return ret; } tile += tile_delta; diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp index a84fada4d6..b7a17848d2 100644 --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -434,10 +434,6 @@ CommandCost CmdBuildBridge(DoCommandFlags flags, TileIndex tile_end, TileIndex t break; default: - /*if (!(GetStationType(tile) == StationType::Dock && _settings_game.construction.allow_docks_under_bridges)) { - CommandCost ret = Command::Do(flags, tile); - if (ret.Failed()) return ret; - }*/ break; } } diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index d1e3d527b1..1cac86f17d 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -227,7 +227,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlags flags, TileIndex start_tile, Axi layout_ptr.resize(count); if (spec == nullptr) { /* The layout must be 0 for the 'normal' waypoints by design. */ - //memset(layout_ptr, 0, count); + //memset(layout_ptr, 0, count); //FIXME } else { /* But for NewGRF waypoints we like to have their style. */ GetStationLayout(&layout_ptr[0], count, 1, spec);