summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 2ed69815c..a77a537eb 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -299,7 +299,11 @@ GRFListCompatibility IsGoodGRFConfigList(GRFConfig *grfconfig)
if (f != NULL) {
md5sumToString(buf, lastof(buf), c->ident.md5sum);
DEBUG(grf, 1, "NewGRF %08X (%s) not found; checksum %s. Compatibility mode on", BSWAP32(c->ident.grfid), c->filename, buf);
- SetBit(c->flags, GCF_COMPATIBLE);
+ if (!HasBit(c->flags, GCF_COMPATIBLE)) {
+ /* Preserve original_md5sum after it has been assigned */
+ SetBit(c->flags, GCF_COMPATIBLE);
+ memcpy(c->original_md5sum, c->ident.md5sum, sizeof(c->original_md5sum));
+ }
/* Non-found has precedence over compatibility load */
if (res != GLC_NOT_FOUND) res = GLC_COMPATIBLE;