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

Method GetPower

src/script/api/script_engine.cpp:146–153  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

144}
145
146/* static */ SQInteger ScriptEngine::GetPower(EngineID engine_id)
147{
148 if (!IsValidEngine(engine_id)) return -1;
149 if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL && GetVehicleType(engine_id) != ScriptVehicle::VT_ROAD) return -1;
150 if (IsWagon(engine_id)) return -1;
151
152 return ::Engine::Get(engine_id)->GetPower();
153}
154
155/* static */ SQInteger ScriptEngine::GetWeight(EngineID engine_id)
156{

Callers

nothing calls this directly

Calls 1

IsWagonFunction · 0.85

Tested by

no test coverage detected