summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-11-12 20:42:35 +0000
committerglx <glx@openttd.org>2007-11-12 20:42:35 +0000
commitde7f58d5d4411035abb0f324fdb5afeed9d20534 (patch)
tree909571993ba3e25d2847f865f84ee42db342beda /src
parent60ccc5bbce380f8b6203902b9206e0e86ba8462b (diff)
downloadopenttd-de7f58d5d4411035abb0f324fdb5afeed9d20534.tar.xz
(svn r11424) -Fix: an override can be set only once
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_commons.cpp2
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;
}