summaryrefslogtreecommitdiff
path: root/src/newgrf_commons.h
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-09-26 02:15:00 +0000
committerbelugas <belugas@openttd.org>2007-09-26 02:15:00 +0000
commit21cbc7009fe70737882d412cf67f9508e0cfd6d2 (patch)
tree083a03dd434de9eab50697187b6b15615ab5d2c0 /src/newgrf_commons.h
parenta6c6b355c2e54768bad8de7f4a92adb92b03e778 (diff)
downloadopenttd-21cbc7009fe70737882d412cf67f9508e0cfd6d2.tar.xz
(svn r11163) -Codechange: Verify that the IndustryTileOverrideManager skip the magic value of 0xFF when assigning a new tileID. This is really important, since the value is reserved for water checking.
Diffstat (limited to 'src/newgrf_commons.h')
-rw-r--r--src/newgrf_commons.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h
index 25933117e..51ebd93b8 100644
--- a/src/newgrf_commons.h
+++ b/src/newgrf_commons.h
@@ -33,6 +33,7 @@ protected:
uint16 max_new_entities; ///< what is the amount of entities, old and new summed
uint16 invalid_ID; ///< ID used to dected invalid entities;
+ virtual bool CheckValidNewID(uint16 testid) { return true; }
public:
EntityIDMapping *mapping_ID; ///< mapping of ids from grf files. Public out of convenience
@@ -76,6 +77,8 @@ public:
struct IndustryTileSpec;
class IndustryTileOverrideManager : public OverrideManagerBase {
+protected:
+ virtual bool CheckValidNewID(uint16 testid) { return testid != 0xFF; }
public:
IndustryTileOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
OverrideManagerBase(offset, maximum, invalid) {}