summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-07-03 20:02:14 +0000
committerfrosch <frosch@openttd.org>2010-07-03 20:02:14 +0000
commit4f51623d122faa068e30224a9351ecb290a70029 (patch)
tree380e12ddbe77f2840dcf9dac86f0d0c1622a18e5
parentddf11b7d3f1671a251b859d0ead13cdbe117fbc7 (diff)
downloadopenttd-4f51623d122faa068e30224a9351ecb290a70029.tar.xz
(svn r20066) -Fix: When rescanning NewGRFs resp. after content download also check whether compatible grfs are available now.
-rw-r--r--src/newgrf_gui.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 566bcbb4e..290f30e88 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -713,20 +713,20 @@ struct NewGRFWindow : public QueryStringBaseWindow {
case 1:
/* Search the list for items that are now found and mark them as such. */
- for (GRFConfig *c = this->actives; c != NULL; c = c->next) {
- if (c->status != GCS_NOT_FOUND) continue;
+ for (GRFConfig **l = &this->actives; *l != NULL; l = &(*l)->next) {
+ GRFConfig *c = *l;
+ bool compatible = HasBit(c->flags, GCF_COMPATIBLE);
+ if (c->status != GCS_NOT_FOUND && !compatible) continue;
- const GRFConfig *f = FindGRFConfig(c->ident.grfid, c->ident.md5sum);
+ const GRFConfig *f = FindGRFConfig(c->ident.grfid, compatible ? c->original_md5sum : c->ident.md5sum);
if (f == NULL) continue;
- free(c->filename);
- free(c->name);
- free(c->info);
+ *l = DuplicateGRFConfig(f);
+ (*l)->next = c->next;
- c->filename = f->filename == NULL ? NULL : strdup(f->filename);
- c->name = f->name == NULL ? NULL : strdup(f->name);
- c->info = f->info == NULL ? NULL : strdup(f->info);
- c->status = GCS_UNKNOWN;
+ if (active_sel == c) active_sel = *l;
+
+ delete c;
}
/* Fall through. */
case 4: