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

Method GetWeight

src/script/api/script_engine.cpp:155–161  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

153}
154
155/* static */ SQInteger ScriptEngine::GetWeight(EngineID engine_id)
156{
157 if (!IsValidEngine(engine_id)) return -1;
158 if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL && GetVehicleType(engine_id) != ScriptVehicle::VT_ROAD) return -1;
159
160 return ::Engine::Get(engine_id)->GetDisplayWeight();
161}
162
163/* static */ SQInteger ScriptEngine::GetMaxTractiveEffort(EngineID engine_id)
164{

Callers

nothing calls this directly

Calls 1

GetDisplayWeightMethod · 0.80

Tested by

no test coverage detected