summaryrefslogtreecommitdiff
path: root/src/newgrf_config.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-04-04 12:43:43 +0000
committerrubidium <rubidium@openttd.org>2007-04-04 12:43:43 +0000
commit3b8dd00bae0ca79bdab4c76c6fc9b73c31dd4615 (patch)
treea7cd2e3b2fdc92211af1949fc0647fb718f1f15c /src/newgrf_config.cpp
parentdb915888459efb46775299c84e0a78ffa23e6076 (diff)
downloadopenttd-3b8dd00bae0ca79bdab4c76c6fc9b73c31dd4615.tar.xz
(svn r9561) -Fix (r9561): loading the newgrfs in openttd.cfg was broken.
Note: as the 'full' path is stored of the newgrfs, the newgrfs in the old cfgs are not made default (you have to set them again).
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r--src/newgrf_config.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 60563ba35..74c4ba525 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -64,6 +64,10 @@ bool FillGRFDetails(GRFConfig *config, bool is_static)
return false;
}
+ if (config->filename == NULL) {
+ config->filename = strdup(strrchr(config->full_path, PATHSEPCHAR) + 1);
+ }
+
/* Find and load the Action 8 information */
/* 62 is the last file slot before sample.cat.
* Should perhaps be some "don't care" value */
@@ -305,7 +309,6 @@ static uint ScanPath(const char *path)
GRFConfig *c = CallocT<GRFConfig>(1);
c->full_path = strdup(filename);
- c->filename = strdup(strrchr(filename, PATHSEPCHAR) + 1);
bool added = true;
if (FillGRFDetails(c, false)) {