diff options
author | PeterN <peter1138@openttd.org> | 2021-05-08 11:36:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-08 11:36:39 +0100 |
commit | 69e5da0b544e83ed445cf500938c24602230fa2c (patch) | |
tree | 5cfd1526084cc242bd78d2fcffa9b3f99b2001e6 /src/saveload | |
parent | 881e1da51d47bde0b6ddf86be1da55aceced7839 (diff) | |
download | openttd-69e5da0b544e83ed445cf500938c24602230fa2c.tar.xz |
Codechange: Don't save unused NewGRF override mappings. (#9202)
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/newgrf_sl.cpp | 1 |
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); } |