summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorPeterN <peter1138@openttd.org>2021-05-12 08:11:14 +0100
committerGitHub <noreply@github.com>2021-05-12 09:11:14 +0200
commit3d9436bd75d2d6ff2024ac4ccacf8d6e1e730cc3 (patch)
tree3b5ee7bc080fac43ffa51ee23323598d5adf0e89 /src/saveload
parentc0a0d85d202843ca68dbc3cd817158a6ccfb53d5 (diff)
downloadopenttd-3d9436bd75d2d6ff2024ac4ccacf8d6e1e730cc3.tar.xz
Fix #9202: Invalid test for unset NewGRF override mapping. (#9226)
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/newgrf_sl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/saveload/newgrf_sl.cpp b/src/saveload/newgrf_sl.cpp
index f7f6ab72e..2e9f1ccaf 100644
--- a/src/saveload/newgrf_sl.cpp
+++ b/src/saveload/newgrf_sl.cpp
@@ -30,7 +30,8 @@ static const SaveLoad _newgrf_mapping_desc[] = {
void Save_NewGRFMapping(const OverrideManagerBase &mapping)
{
for (uint i = 0; i < mapping.GetMaxMapping(); i++) {
- if (!mapping.IsValidID(i)) continue;
+ if (mapping.mapping_ID[i].grfid == 0 &&
+ mapping.mapping_ID[i].entity_id == 0) continue;
SlSetArrayIndex(i);
SlObject(&mapping.mapping_ID[i], _newgrf_mapping_desc);
}