diff --git a/src/bridge.h b/src/bridge.h --- a/src/bridge.h +++ b/src/bridge.h @@ -67,7 +67,7 @@ static inline const BridgeSpec *GetBridg void DrawBridgeMiddle(const TileInfo *ti); -bool CheckBridge_Stuff(BridgeType bridge_type, uint bridge_len, DoCommandFlag flags = DC_NONE); +bool CheckBridgeAvailability(BridgeType bridge_type, uint bridge_len, DoCommandFlag flags = DC_NONE); int CalcBridgeLenCostFactor(int x); void ResetBridges(); diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -375,7 +375,7 @@ void ShowBuildBridgeWindow(TileIndex sta case TRANSPORT_RAIL: last_bridge_type = _last_railbridge_type; break; default: break; // water ways and air routes don't have bridge types } - if (_ctrl_pressed && CheckBridge_Stuff(last_bridge_type, bridge_len)) { + if (_ctrl_pressed && CheckBridgeAvailability(last_bridge_type, bridge_len)) { DoCommandP(end, start, type | last_bridge_type, CMD_BUILD_BRIDGE | CMD_MSG(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE), CcBuildBridge); return; } @@ -396,7 +396,7 @@ void ShowBuildBridgeWindow(TileIndex sta /* loop for all bridgetypes */ for (BridgeType brd_type = 0; brd_type != MAX_BRIDGES; brd_type++) { - if (CheckBridge_Stuff(brd_type, bridge_len)) { + if (CheckBridgeAvailability(brd_type, bridge_len)) { /* bridge is accepted, add to list */ BuildBridgeData *item = bl->Append(); item->index = brd_type; diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp --- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -163,7 +163,12 @@ static CommandCost CheckBridgeSlopeSouth return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]); } -bool CheckBridge_Stuff(BridgeType bridge_type, uint bridge_len, DoCommandFlag flags) +/** Is a bridge of the specified type and length available? + * @param bridge_type Wanted type of bridge. + * @param bridge_len Wanted length of the bridge. + * @return The requested bridge is available. + */ +bool CheckBridgeAvailability(BridgeType bridge_type, uint bridge_len, DoCommandFlag flags) { if (flags & DC_QUERY_COST) { return bridge_len <= (_settings_game.construction.longbridges ? 100U : 16U); @@ -243,7 +248,7 @@ CommandCost CmdBuildBridge(TileIndex end uint bridge_len = GetTunnelBridgeLength(tile_start, tile_end); if (transport_type != TRANSPORT_WATER) { /* set and test bridge length, availability */ - if (!CheckBridge_Stuff(bridge_type, bridge_len, flags)) return_cmd_error(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE); + if (!CheckBridgeAvailability(bridge_type, bridge_len, flags)) return_cmd_error(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE); } else { if (bridge_len > (_settings_game.construction.longbridges ? 100U : 16U)) return_cmd_error(STR_ERROR_CAN_T_BUILD_BRIDGE_HERE); }