diff options
author | frosch <frosch@openttd.org> | 2011-01-15 21:13:47 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-01-15 21:13:47 +0000 |
commit | 6e4dd5615878c658cf687a73dc1990f9e903df86 (patch) | |
tree | 29eddd4bfb56a83ab7ba2e131372d79535fb8b79 /src/newgrf_gui.cpp | |
parent | 4d8a93c870428d8cdffad9a453aef91a1365f97e (diff) | |
download | openttd-6e4dd5615878c658cf687a73dc1990f9e903df86.tar.xz |
(svn r21814) -Fix/Add: Check GRF version from action 8, and disallow usage of GRFs with versions above 7.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r-- | src/newgrf_gui.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 913a8ff29..2034ae6ab 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -115,6 +115,7 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint right, uint /* Show flags */ if (c->status == GCS_NOT_FOUND) y = DrawStringMultiLine(x, right, y, bottom, STR_NEWGRF_SETTINGS_NOT_FOUND); if (c->status == GCS_DISABLED) y = DrawStringMultiLine(x, right, y, bottom, STR_NEWGRF_SETTINGS_DISABLED); + if (HasBit(c->flags, GCF_INVALID)) y = DrawStringMultiLine(x, right, y, bottom, STR_NEWGRF_SETTINGS_INCOMPATIBLE); if (HasBit(c->flags, GCF_COMPATIBLE)) y = DrawStringMultiLine(x, right, y, bottom, STR_NEWGRF_COMPATIBLE_LOADED); /* Draw GRF info if it exists */ @@ -888,7 +889,7 @@ struct NewGRFWindow : public QueryStringBaseWindow { } case SNGRFS_ADD: { - if (this->avail_sel == NULL || !this->editable) break; + if (this->avail_sel == NULL || !this->editable || HasBit(this->avail_sel->flags, GCF_INVALID)) break; GRFConfig **list; /* Find last entry in the list, checking for duplicate grfid on the way */ @@ -1047,7 +1048,7 @@ struct NewGRFWindow : public QueryStringBaseWindow { if (c->status != GCS_NOT_FOUND && !compatible) continue; const GRFConfig *f = FindGRFConfig(c->ident.grfid, FGCM_EXACT, compatible ? c->original_md5sum : c->ident.md5sum); - if (f == NULL) continue; + if (f == NULL || HasBit(f->flags, GCF_INVALID)) continue; *l = new GRFConfig(*f); (*l)->next = c->next; @@ -1084,7 +1085,7 @@ struct NewGRFWindow : public QueryStringBaseWindow { SNGRFS_TOGGLE_PALETTE, WIDGET_LIST_END ); - this->SetWidgetDisabledState(SNGRFS_ADD, !this->editable || this->avail_sel == NULL); + this->SetWidgetDisabledState(SNGRFS_ADD, !this->editable || this->avail_sel == NULL || HasBit(this->avail_sel->flags, GCF_INVALID)); bool disable_all = this->active_sel == NULL || !this->editable; this->SetWidgetsDisabledState(disable_all, @@ -1233,7 +1234,7 @@ private: if (_settings_client.gui.newgrf_show_old_versions) { *this->avails.Append() = c; } else { - const GRFConfig *best = FindGRFConfig(c->ident.grfid, FGCM_NEWEST); + const GRFConfig *best = FindGRFConfig(c->ident.grfid, HasBit(c->flags, GCF_INVALID) ? FGCM_NEWEST : FGCM_NEWEST_VALID); /* * If the best version is 0, then all NewGRF with this GRF ID * have version 0, so for backward compatability reasons we |