summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorPeterN <peter1138@openttd.org>2021-05-08 11:36:39 +0100
committerGitHub <noreply@github.com>2021-05-08 11:36:39 +0100
commit69e5da0b544e83ed445cf500938c24602230fa2c (patch)
tree5cfd1526084cc242bd78d2fcffa9b3f99b2001e6 /src/saveload
parent881e1da51d47bde0b6ddf86be1da55aceced7839 (diff)
downloadopenttd-69e5da0b544e83ed445cf500938c24602230fa2c.tar.xz
Codechange: Don't save unused NewGRF override mappings. (#9202)
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/newgrf_sl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/saveload/newgrf_sl.cpp b/src/saveload/newgrf_sl.cpp
index b2d2b0df9..f7f6ab72e 100644
--- a/src/saveload/newgrf_sl.cpp
+++ b/src/saveload/newgrf_sl.cpp
@@ -30,6 +30,7 @@ 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;
SlSetArrayIndex(i);
SlObject(&mapping.mapping_ID[i], _newgrf_mapping_desc);
}