Fix: compatible NewGRFs in crash-log reported wrong md5 (#9340)

The text suggests it reports the original md5, but it does in fact
report the replaced md5. Now it reports both.

(cherry picked from commit f997eb6ca4)
This commit is contained in:
Patric Stout
2021-06-08 20:30:44 +02:00
committed by Jonathan G Rennison
parent 9299a29a52
commit 3411203e5d

View File

@@ -444,9 +444,11 @@ static void CDECL HandleSavegameLoadCrash(int signum)
for (const GRFConfig *c = _grfconfig; c != nullptr; c = c->next) { for (const GRFConfig *c = _grfconfig; c != nullptr; c = c->next) {
if (HasBit(c->flags, GCF_COMPATIBLE)) { if (HasBit(c->flags, GCF_COMPATIBLE)) {
const GRFIdentifier *replaced = GetOverriddenIdentifier(c); const GRFIdentifier *replaced = GetOverriddenIdentifier(c);
char buf[40]; char original_md5[40];
md5sumToString(buf, lastof(buf), replaced->md5sum); char replaced_md5[40];
p += seprintf(p, lastof(buffer), "NewGRF %08X (checksum %s) not found.\n Loaded NewGRF \"%s\" with same GRF ID instead.\n", BSWAP32(c->ident.grfid), buf, c->filename); md5sumToString(original_md5, lastof(original_md5), c->original_md5sum);
md5sumToString(replaced_md5, lastof(replaced_md5), replaced->md5sum);
p += seprintf(p, lastof(buffer), "NewGRF %08X (checksum %s) not found.\n Loaded NewGRF \"%s\" (checksum %s) with same GRF ID instead.\n", BSWAP32(c->ident.grfid), original_md5, c->filename, replaced_md5);
} }
if (c->status == GCS_NOT_FOUND) { if (c->status == GCS_NOT_FOUND) {
char buf[40]; char buf[40];