summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-06-13 14:07:49 +0000
committerfrosch <frosch@openttd.org>2010-06-13 14:07:49 +0000
commit641fc68aa80fc24fa277ae3dc62eec2969bdd26b (patch)
tree1e980b24f7e52733370eee2a40ee009e3b8ded97 /src/newgrf_config.cpp
parent67bec51f27d47949010ae4eaf777a622619893c8 (diff)
downloadopenttd-641fc68aa80fc24fa277ae3dc62eec2969bdd26b.tar.xz
(svn r19971) -Codechange: Make IsGoodGRFConfigList() operate on any given GRFConfig and move the GameLog operations directly to AfterLoad().
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 8f4d70f19..2ed69815c 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -276,6 +276,7 @@ void ResetGRFConfig(bool defaults)
/** Check if all GRFs in the GRF config from a savegame can be loaded.
+ * @param grfconfig GrfConfig to check
* @return will return any of the following 3 values:<br>
* <ul>
* <li> GLC_ALL_GOOD: No problems occured, all GRF files were found and loaded
@@ -283,11 +284,11 @@ void ResetGRFConfig(bool defaults)
* compatible GRF with the same grfid was found and used instead
* <li> GLC_NOT_FOUND: For one or more GRF's no match was found at all
* </ul> */
-GRFListCompatibility IsGoodGRFConfigList()
+GRFListCompatibility IsGoodGRFConfigList(GRFConfig *grfconfig)
{
GRFListCompatibility res = GLC_ALL_GOOD;
- for (GRFConfig *c = _grfconfig; c != NULL; c = c->next) {
+ for (GRFConfig *c = grfconfig; c != NULL; c = c->next) {
const GRFConfig *f = FindGRFConfig(c->ident.grfid, c->ident.md5sum);
if (f == NULL) {
char buf[256];
@@ -302,7 +303,6 @@ GRFListCompatibility IsGoodGRFConfigList()
/* Non-found has precedence over compatibility load */
if (res != GLC_NOT_FOUND) res = GLC_COMPATIBLE;
- GamelogGRFCompatible(&f->ident);
goto compatible_grf;
}
@@ -310,8 +310,6 @@ GRFListCompatibility IsGoodGRFConfigList()
md5sumToString(buf, lastof(buf), c->ident.md5sum);
DEBUG(grf, 0, "NewGRF %08X (%s) not found; checksum %s", BSWAP32(c->ident.grfid), c->filename, buf);
- GamelogGRFRemove(c->ident.grfid);
-
c->status = GCS_NOT_FOUND;
res = GLC_NOT_FOUND;
} else {