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

Function IsWagon

src/engine.cpp:624–628  ·  view source on GitHub ↗

* Determine whether an engine type is a wagon (and not a loco). * @param index %Engine getting queried. * @return Whether the queried engine is a wagon. */

Source from the content-addressed store, hash-verified

622 * @return Whether the queried engine is a wagon.
623 */
624static bool IsWagon(EngineID index)
625{
626 const Engine *e = Engine::Get(index);
627 return e->type == VEH_TRAIN && e->VehInfo<RailVehicleInfo>().railveh_type == RAILVEH_WAGON;
628}
629
630/**
631 * Ensure engine is not set as the last used variant for any other engine.

Callers 6

NewVehicleAvailableFunction · 0.85
GetReliabilityMethod · 0.85
GetMaxAgeMethod · 0.85
GetPowerMethod · 0.85
GetMaxTractiveEffortMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected