MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetPrice

Method GetPrice

src/script/api/script_bridge.cpp:148–155  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

146}
147
148/* static */ Money ScriptBridge::GetPrice(BridgeType bridge_type, SQInteger length)
149{
150 if (!IsValidBridge(bridge_type)) return -1;
151
152 length = Clamp<SQInteger>(length, 0, INT32_MAX);
153
154 return ::CalcBridgeLenCostFactor(length) * _price[PR_BUILD_BRIDGE] * ::GetBridgeSpec(bridge_type)->price >> 8;
155}
156
157/* static */ SQInteger ScriptBridge::GetMaxLength(BridgeType bridge_type)
158{

Callers

nothing calls this directly

Calls 2

CalcBridgeLenCostFactorFunction · 0.85
GetBridgeSpecFunction · 0.85

Tested by

no test coverage detected