mirror of https://github.com/OpenTTD/OpenTTD
(svn r19559) -Codechange: Rename CheckBridge_Stuff() to CheckBridgeAvailability().
parent
6934e6fe7d
commit
7f5a0751e2
|
@ -67,7 +67,7 @@ static inline const BridgeSpec *GetBridgeSpec(BridgeType i)
|
|||
|
||||
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();
|
||||
|
|
|
@ -375,7 +375,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
|
|||
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 start, TileIndex end, TransportType transpo
|
|||
|
||||
/* 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;
|
||||
|
|
|
@ -163,7 +163,12 @@ static CommandCost CheckBridgeSlopeSouth(Axis axis, Slope *tileh, uint *z)
|
|||
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_tile, DoCommandFlag flags, uint32 p1, u
|
|||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue