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

Method IsWagon

src/script/api/script_engine.cpp:192–198  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

190}
191
192/* static */ bool ScriptEngine::IsWagon(EngineID engine_id)
193{
194 if (!IsValidEngine(engine_id)) return false;
195 if (GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL) return false;
196
197 return ::RailVehInfo(engine_id)->power == 0;
198}
199
200/* static */ bool ScriptEngine::CanRunOnRail(EngineID engine_id, ScriptRail::RailType track_rail_type)
201{

Callers 1

NormaliseSubtypesFunction · 0.45

Calls 1

RailVehInfoFunction · 0.85

Tested by

no test coverage detected