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

Method GetReliability

src/script/api/script_engine.cpp:106–112  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

104}
105
106/* static */ SQInteger ScriptEngine::GetReliability(EngineID engine_id)
107{
108 if (!IsValidEngine(engine_id)) return -1;
109 if (GetVehicleType(engine_id) == ScriptVehicle::VT_RAIL && IsWagon(engine_id)) return -1;
110
111 return ::ToPercent16(::Engine::Get(engine_id)->reliability);
112}
113
114/* static */ SQInteger ScriptEngine::GetMaxSpeed(EngineID engine_id)
115{

Callers

nothing calls this directly

Calls 2

IsWagonFunction · 0.85
ToPercent16Function · 0.85

Tested by

no test coverage detected