diff options
author | frosch <frosch@openttd.org> | 2011-11-01 00:23:41 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-11-01 00:23:41 +0000 |
commit | acc3c75951c4db0873db794b657697774f0ff9e9 (patch) | |
tree | 2b7e5f953286b09c3c07688c9e8c49ee953c5adb /src/engine_base.h | |
parent | 72cd855978bf45fd444eae72551a12e13a35b0c8 (diff) | |
download | openttd-acc3c75951c4db0873db794b657697774f0ff9e9.tar.xz |
(svn r23075) -Codechange: Add GetGRF() and GetGRFID() methods to Engine and Vehicle to simplify code.
Diffstat (limited to 'src/engine_base.h')
-rw-r--r-- | src/engine_base.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/engine_base.h b/src/engine_base.h index a2dd0b1dd..f118b8387 100644 --- a/src/engine_base.h +++ b/src/engine_base.h @@ -101,6 +101,18 @@ struct Engine : EnginePool::PoolItem<&_engine_pool> { { return this->type == VEH_TRAIN || this->type == VEH_ROAD; } + + /** + * Retrieve the NewGRF the engine is tied to. + * This is the GRF providing the Action 3. + * @return NewGRF associated to the engine. + */ + const GRFFile *GetGRF() const + { + return this->grf_prop.grffile; + } + + uint32 GetGRFID() const; }; struct EngineIDMapping { |