diff options
author | yexo <yexo@openttd.org> | 2010-07-31 09:32:44 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-07-31 09:32:44 +0000 |
commit | 1ca16aa979fab1d7a60fb40def0374433362d265 (patch) | |
tree | 6897f2e35c723031aedf1c44c99c01731b8efa1e /src/newgrf_gui.cpp | |
parent | 24df43633cb1f647f71867512ce4cbc9f9672561 (diff) | |
download | openttd-1ca16aa979fab1d7a60fb40def0374433362d265.tar.xz |
(svn r20248) -Codechange: use a copy-constructor instead of a separate function co clone GRFConfig/GRFError
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r-- | src/newgrf_gui.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 195893db7..77bcedb63 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -548,8 +548,7 @@ struct NewGRFWindow : public QueryStringBaseWindow { } } - GRFConfig *c = DuplicateGRFConfig(this->avail_sel); // Copy GRF details from scanned list. - c->next = NULL; + GRFConfig *c = new GRFConfig(*this->avail_sel); // Copy GRF details from scanned list. *list = c; // Append GRF config to configuration list. /* Select next (or previous, if last one) item in the list. */ @@ -720,7 +719,7 @@ struct NewGRFWindow : public QueryStringBaseWindow { const GRFConfig *f = FindGRFConfig(c->ident.grfid, compatible ? c->original_md5sum : c->ident.md5sum); if (f == NULL) continue; - *l = DuplicateGRFConfig(f); + *l = new GRFConfig(*f); (*l)->next = c->next; if (active_sel == c) active_sel = *l; |