diff options
author | yexo <yexo@openttd.org> | 2010-02-25 20:05:31 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-02-25 20:05:31 +0000 |
commit | a9c8dbc0a0e1f1fc4434cf0c83ff658ab8d9e3d9 (patch) | |
tree | be44c4af53164b9307d95a0021c276ec2b57f41c /src/saveload/afterload.cpp | |
parent | 4377b5fd44f5267f89f565e46cdb3646cf322a93 (diff) | |
download | openttd-a9c8dbc0a0e1f1fc4434cf0c83ff658ab8d9e3d9.tar.xz |
(svn r19255) -Codechange: encapsulate GRFIdentifier in GRFConfig instead of subclassing it
Diffstat (limited to 'src/saveload/afterload.cpp')
-rw-r--r-- | src/saveload/afterload.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index f918e9972..e4c3e865a 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -301,14 +301,14 @@ static void ResetSignalHandlers() static const GRFIdentifier *GetOverriddenIdentifier(const GRFConfig *c) { const LoggedAction *la = &_gamelog_action[_gamelog_actions - 1]; - if (la->at != GLAT_LOAD) return c; + if (la->at != GLAT_LOAD) return &c->ident; const LoggedChange *lcend = &la->change[la->changes]; for (const LoggedChange *lc = la->change; lc != lcend; lc++) { - if (lc->ct == GLCT_GRFCOMPAT && lc->grfcompat.grfid == c->grfid) return &lc->grfcompat; + if (lc->ct == GLCT_GRFCOMPAT && lc->grfcompat.grfid == c->ident.grfid) return &lc->grfcompat; } - return c; + return &c->ident; } /** Was the saveload crash because of missing NewGRFs? */ @@ -354,13 +354,13 @@ static void CDECL HandleSavegameLoadCrash(int signum) 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->grfid), buf, c->filename); + 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); _saveload_crash_with_missing_newgrfs = true; } if (c->status == GCS_NOT_FOUND) { char buf[40]; - md5sumToString(buf, lastof(buf), c->md5sum); - p += seprintf(p, lastof(buffer), "NewGRF %08X (%s) not found; checksum %s.\n", BSWAP32(c->grfid), c->filename, buf); + 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); _saveload_crash_with_missing_newgrfs = true; } } |