summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-07-27 02:41:29 +0000
committerbelugas <belugas@openttd.org>2007-07-27 02:41:29 +0000
commit8ad3a6f8fdf6d0a67e060121463aae10a6f0c3a5 (patch)
tree44d52fd6c7a79f68bf1a2e8591ceab86dd79083e /src/industry_cmd.cpp
parent205e700b265464f80cf76db88a40a129ffc3d9f7 (diff)
downloadopenttd-8ad3a6f8fdf6d0a67e060121463aae10a6f0c3a5.tar.xz
(svn r10700) -Codechange: Enable to jump (by default) to the overriding industry tile spec of the one been queried.
Only on certain very specific circumstances do we need the original spec
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index bbdab2415..25228fe95 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -124,13 +124,19 @@ const IndustrySpec *GetIndustrySpec(IndustryType thistype)
* This will ensure at once : proper access and
* not allowing modifications of it.
* @param gfx of industrytile (which is the index in _industry_tile_specs)
+ * @param full_check (default to true) verify if an override is available.
+ * If so, use it instead of the gfx provided.
* @pre gfx < INVALID_INDUSTRYTILE
* @return a pointer to the corresponding industrytile spec
**/
-const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx)
+const IndustryTileSpec *GetIndustryTileSpec(IndustryGfx gfx, bool full_check)
{
assert(gfx < INVALID_INDUSTRYTILE);
- return &_industry_tile_specs[gfx];
+ const IndustryTileSpec *its = &_industry_tile_specs[gfx];
+ if (full_check && its->grf_prop.override != INVALID_INDUSTRYTILE) {
+ its = &_industry_tile_specs[its->grf_prop.override];
+ }
+ return its;
}
void DestroyIndustry(Industry *i)