diff options
author | rubidium <rubidium@openttd.org> | 2007-06-17 15:48:57 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-06-17 15:48:57 +0000 |
commit | 3c7a85fe9456b2bc31f3d29198bf2ec060e176f3 (patch) | |
tree | 8bc2a050b44170ed785af66e6e9045d429c789db /src/newgrf_config.cpp | |
parent | 4e4b152adb9e4fed758748622c66991be2aad730 (diff) | |
download | openttd-3c7a85fe9456b2bc31f3d29198bf2ec060e176f3.tar.xz |
(svn r10182) -Codechange: rewrite most part of the file loading/searching to be more flexible.
-Codechange: add support for personal directories on Windows.
-Fix [FS#153, FS#193, FS#502, FS#816, FS#854]: fix issues related to fixed names, fixed places of files/directories and application bundles.
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r-- | src/newgrf_config.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 6d6709c6b..74ec3b837 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -363,14 +363,16 @@ static uint ScanPath(const char *path, int basepath_length) /* Scan for all NewGRFs */ void ScanNewGRFFiles() { - uint num; + Searchpath sp; + char path[MAX_PATH]; + uint num = 0; ClearGRFConfigList(&_all_grfs); DEBUG(grf, 1, "Scanning for NewGRFs"); - num = ScanPath(_paths.data_dir, strlen(_paths.data_dir)); - if (_paths.second_data_dir != NULL) { - num += ScanPath(_paths.second_data_dir, strlen(_paths.second_data_dir)); + FOR_ALL_SEARCHPATHS(sp) { + FioAppendDirectory(path, MAX_PATH, sp, DATA_DIR); + num += ScanPath(path, strlen(path)); } DEBUG(grf, 1, "Scan complete, found %d files", num); } |