summaryrefslogtreecommitdiff
path: root/src/newgrf_commons.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_commons.cpp')
-rw-r--r--src/newgrf_commons.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp
index 6ffd879e0..173997d99 100644
--- a/src/newgrf_commons.cpp
+++ b/src/newgrf_commons.cpp
@@ -105,7 +105,7 @@ uint16 OverrideManagerBase::AddEntityID(byte grf_local_id, uint32 grfid, byte su
for (id = max_offset; id < max_new_entities; id++) {
map = &mapping_ID[id];
- if (map->entity_id == 0 && map->grfid == 0) {
+ if (CheckValidNewID(id) && map->entity_id == 0 && map->grfid == 0) {
map->entity_id = grf_local_id;
map->grfid = grfid;
map->substitute_id = substitute_id;