diff options
author | glx <glx@openttd.org> | 2007-11-12 20:42:35 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2007-11-12 20:42:35 +0000 |
commit | 9cee4e91cb736db6dfd4541e00cf8e077158a0b7 (patch) | |
tree | 909571993ba3e25d2847f865f84ee42db342beda | |
parent | de4e9cdc9c7f2bfe4b073c62e2cd5759be435d7b (diff) | |
download | openttd-9cee4e91cb736db6dfd4541e00cf8e077158a0b7.tar.xz |
(svn r11424) -Fix: an override can be set only once
-rw-r--r-- | src/newgrf_commons.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index 823c0f918..5afcab114 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -50,6 +50,8 @@ OverrideManagerBase::~OverrideManagerBase() void OverrideManagerBase::Add(uint8 local_id, uint32 grfid, uint entity_type) { assert(entity_type < max_offset); + /* An override can be set only once */ + if (entity_overrides[entity_type] != invalid_ID) return; entity_overrides[entity_type] = local_id; grfid_overrides[entity_type] = grfid; } |