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

Method GetMaxAge

src/script/api/script_engine.cpp:131–137  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

129}
130
131/* static */ SQInteger ScriptEngine::GetMaxAge(EngineID engine_id)
132{
133 if (!IsValidEngine(engine_id)) return -1;
134 if (GetVehicleType(engine_id) == ScriptVehicle::VT_RAIL && IsWagon(engine_id)) return -1;
135
136 return ::Engine::Get(engine_id)->GetLifeLengthInDays().base();
137}
138
139/* static */ Money ScriptEngine::GetRunningCost(EngineID engine_id)
140{

Callers

nothing calls this directly

Calls 3

IsWagonFunction · 0.85
GetLifeLengthInDaysMethod · 0.80
baseMethod · 0.45

Tested by

no test coverage detected