diff options
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); } |