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

Method HasEngineType

src/vehicle.cpp:702–711  ·  view source on GitHub ↗

* Check whether Vehicle::engine_type has any meaning. * @return true if the vehicle has a usable engine type. */

Source from the content-addressed store, hash-verified

700 * @return true if the vehicle has a usable engine type.
701 */
702bool Vehicle::HasEngineType() const
703{
704 switch (this->type) {
705 case VEH_AIRCRAFT: return Aircraft::From(this)->IsNormalAircraft();
706 case VEH_TRAIN:
707 case VEH_ROAD:
708 case VEH_SHIP: return true;
709 default: return false;
710 }
711}
712
713/**
714 * Retrieves the engine of the vehicle.

Callers 2

VehicleServiceInDepotFunction · 0.80
RunEconomyVehicleDayProcFunction · 0.80

Calls 1

IsNormalAircraftMethod · 0.80

Tested by

no test coverage detected