(svn r20066) -Fix: When rescanning NewGRFs resp. after content download also check whether compatible grfs are available now.

This commit is contained in:
frosch 2010-07-03 20:02:14 +00:00
parent 2105d5e187
commit df14436b7b

View File

@ -713,20 +713,20 @@ struct NewGRFWindow : public QueryStringBaseWindow {
case 1: case 1:
/* Search the list for items that are now found and mark them as such. */ /* Search the list for items that are now found and mark them as such. */
for (GRFConfig *c = this->actives; c != NULL; c = c->next) { for (GRFConfig **l = &this->actives; *l != NULL; l = &(*l)->next) {
if (c->status != GCS_NOT_FOUND) continue; 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; if (f == NULL) continue;
free(c->filename); *l = DuplicateGRFConfig(f);
free(c->name); (*l)->next = c->next;
free(c->info);
c->filename = f->filename == NULL ? NULL : strdup(f->filename); if (active_sel == c) active_sel = *l;
c->name = f->name == NULL ? NULL : strdup(f->name);
c->info = f->info == NULL ? NULL : strdup(f->info); delete c;
c->status = GCS_UNKNOWN;
} }
/* Fall through. */ /* Fall through. */
case 4: case 4: