diff options
author | frosch <frosch@openttd.org> | 2009-08-17 18:33:48 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-08-17 18:33:48 +0000 |
commit | 8bd029015e312becdaf889337461b9fead742509 (patch) | |
tree | 3ac2ef616460f7c21531a54cec1a924faaac0fe3 /src/engine_base.h | |
parent | 7f030110b0da8db35ad661237a8a1ea5d1c8d8bf (diff) | |
download | openttd-8bd029015e312becdaf889337461b9fead742509.tar.xz |
(svn r17209) -Codechange: Move cargo_type from (Rail|Road|Ship)VehicleInfo to EngineInfo.
Diffstat (limited to 'src/engine_base.h')
-rw-r--r-- | src/engine_base.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/engine_base.h b/src/engine_base.h index 2dab18fd9..5497fee3a 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -49,7 +49,22 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> { Engine(VehicleType type, EngineID base); ~Engine(); - CargoID GetDefaultCargoType() const; + /** + * Determines the default cargo type of an engine. + * + * Usually a valid cargo is returned, even though the vehicle has zero capacity, and can therefore not carry anything. But the cargotype is still used + * for livery selection etc.. + * + * Vehicles with CT_INVALID as default cargo are usally not available, but it can appear as default cargo of articulated parts. + * + * @return The default cargo type. + * @see CanCarryCargo + */ + CargoID GetDefaultCargoType() const + { + return this->info.cargo_type; + } + bool CanCarryCargo() const; uint GetDisplayDefaultCapacity() const; Money GetRunningCost() const; |