1
0
Fork 0

Cleanup: CodeQL fixes

pull/14425/head
Susan 2025-07-11 07:54:29 +01:00
parent 3ef5783bf9
commit a48f491f09
3 changed files with 4 additions and 9 deletions

View File

@ -1405,7 +1405,7 @@ static CommandCost CheckFlatLandRoadStop(TileIndex cur_tile, int &allowed_z, con
(!_settings_game.construction.road_stop_on_competitor_road || (!_settings_game.construction.road_stop_on_competitor_road ||
/* Disallow breaking end-of-line of someone else /* Disallow breaking end-of-line of someone else
* so trams can still reverse on this tile. */ * so trams can still reverse on this tile. */
HasExactlyOneBit(GetRoadBits(cur_tile, RTT_TRAM)))) { HasExactlyOneBit(GetRoadBits(cur_tile, RTT_TRAM)))) {
ret = CheckOwnership(tram_owner); ret = CheckOwnership(tram_owner);
if (ret.Failed()) return ret; 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 TileIndexDiff track_delta = TileOffsByAxis(OtherAxis(axis)); // offset to go to the next track
std::vector<uint8_t> layout_buffer; std::vector<uint8_t> layout_buffer;
layout_buffer.resize(numtracks * plat_len); layout_buffer.resize(numtracks * plat_len);
//TempBufferST<uint8_t> layout_buffer(numtracks * plat_len);
GetStationLayout(&layout_buffer[0], numtracks, plat_len, statspec); 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++) { for (uint i = 0; i < numtracks; i++) {
TileIndex tile = tile_track; TileIndex tile = tile_track;
for (uint j = 0; j < plat_len; j++) { 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()) { 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; return ret;
} }
tile += tile_delta; tile += tile_delta;

View File

@ -434,10 +434,6 @@ CommandCost CmdBuildBridge(DoCommandFlags flags, TileIndex tile_end, TileIndex t
break; break;
default: default:
/*if (!(GetStationType(tile) == StationType::Dock && _settings_game.construction.allow_docks_under_bridges)) {
CommandCost ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile);
if (ret.Failed()) return ret;
}*/
break; break;
} }
} }

View File

@ -227,7 +227,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlags flags, TileIndex start_tile, Axi
layout_ptr.resize(count); layout_ptr.resize(count);
if (spec == nullptr) { if (spec == nullptr) {
/* The layout must be 0 for the 'normal' waypoints by design. */ /* The layout must be 0 for the 'normal' waypoints by design. */
//memset(layout_ptr, 0, count); //memset(layout_ptr, 0, count); //FIXME
} else { } else {
/* But for NewGRF waypoints we like to have their style. */ /* But for NewGRF waypoints we like to have their style. */
GetStationLayout(&layout_ptr[0], count, 1, spec); GetStationLayout(&layout_ptr[0], count, 1, spec);