Changeset - r25603:b56d6a8e4f4e
[Not reviewed]
master
0 1 0
Patric Stout - 3 years ago 2021-06-08 18:30:44
truebrain@openttd.org
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.
1 file changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/saveload/afterload.cpp
Show inline comments
 
@@ -399,15 +399,17 @@ static void CDECL HandleSavegameLoadCras
 
			"Please load the savegame with the appropriate NewGRFs installed.\n"
 
			"The missing/compatible NewGRFs are:\n");
 

	
 
		for (const GRFConfig *c = _grfconfig; c != nullptr; c = c->next) {
 
			if (HasBit(c->flags, GCF_COMPATIBLE)) {
 
				const GRFIdentifier *replaced = GetOverriddenIdentifier(c);
 
				char buf[40];
 
				md5sumToString(buf, lastof(buf), replaced->md5sum);
 
				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);
 
				char original_md5[40];
 
				char replaced_md5[40];
 
				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) {
 
				char buf[40];
 
				md5sumToString(buf, lastof(buf), c->ident.md5sum);
 
				p += seprintf(p, lastof(buffer), "NewGRF %08X (%s) not found; checksum %s.\n", BSWAP32(c->ident.grfid), c->filename, buf);
 
			}
0 comments (0 inline, 0 general)