diff options
author | alberth <alberth@openttd.org> | 2014-09-07 16:12:58 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2014-09-07 16:12:58 +0000 |
commit | f72ad87540a5fa575bf790bb2796c484152998b5 (patch) | |
tree | 8d7b659dbd7d3e03717e49fc27b8a658b418c15c /src/engine_base.h | |
parent | eb41511cd1dacb1f9012c64818d26ccb7ec71e00 (diff) | |
download | openttd-f72ad87540a5fa575bf790bb2796c484152998b5.tar.xz |
(svn r26802) -Add: Command to set visibility of an engine for a company (based on patch by Juanjo).
Diffstat (limited to 'src/engine_base.h')
-rw-r--r-- | src/engine_base.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/engine_base.h b/src/engine_base.h index 99a15aaea..6a2e6816c 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -37,6 +37,7 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> { CompanyByte preview_company;///< Company which is currently being offered a preview \c INVALID_COMPANY means no company. byte preview_wait; ///< Daily countdown timer for timeout of offering the engine to the #preview_company company. CompanyMask company_avail; ///< Bit for each company whether the engine is available for that company. + CompanyMask company_hidden; ///< Bit for each company whether the engine is normally hidden in the build gui for that company. uint8 original_image_index; ///< Original vehicle image index, thus the image index of the overridden vehicle VehicleType type; ///< %Vehicle type, ie #VEH_ROAD, #VEH_TRAIN, etc. @@ -112,6 +113,16 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> { uint16 GetRange() const; /** + * Check whether the engine is hidden in the GUI for the given company. + * @param c Company to check. + * @return \c true iff the engine is hidden in the GUI for the given company. + */ + inline bool IsHidden(CompanyByte c) const + { + return c < MAX_COMPANIES && HasBit(this->company_hidden, c); + } + + /** * Check if the engine is a ground vehicle. * @return True iff the engine is a train or a road vehicle. */ |