Removed AutoSearchPath from ddraw.ini

* the folder path for auto-loading custom files is now constant.
This commit is contained in:
NovaRain
2020-06-30 22:02:21 +08:00
parent bfaed2eb68
commit 467d895ba6
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ UseCommandLine=0
;Path to the folder in which the game will automatically search and load custom files (by *.dat mask, including folders)
;The data load order of the files in the folder will be in reverse alphabetical order of the filenames
;The files placed in this folder will have higher priority than the PatchFileXX options
;Uncomment the option to specify a different folder path. The default path is <GameRoot>\mods\
;This option is not used since v4.2.6. The default path is <GameRoot>\mods\
;AutoSearchPath=mods
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+6 -6
View File
@@ -213,14 +213,14 @@ static void GetExtraPatches() {
if (patch.empty() || !NormalizePath(patch) || GetFileAttributes(patch.c_str()) == INVALID_FILE_ATTRIBUTES) continue;
patchFiles.push_back(patch);
}
std::string searchPath = GetConfigString("ExtraPatches", "AutoSearchPath", "mods\\", MAX_PATH);
if (!searchPath.empty() && NormalizePath(searchPath)) {
if (searchPath.back() != '\\') searchPath += "\\";
std::string searchPath = "mods\\"; //GetConfigString("ExtraPatches", "AutoSearchPath", "mods\\", MAX_PATH);
//if (!searchPath.empty() && NormalizePath(searchPath)) {
//if (searchPath.back() != '\\') searchPath += "\\";
std::string path(".\\" + searchPath + "*.dat");
std::string pathMask(".\\mods\\*.dat");
dlogr("Loading custom patches:", DL_MAIN);
WIN32_FIND_DATA findData;
HANDLE hFind = FindFirstFile(path.c_str(), &findData);
HANDLE hFind = FindFirstFile(pathMask.c_str(), &findData);
if (hFind != INVALID_HANDLE_VALUE) {
do {
std::string name(searchPath + findData.cFileName);
@@ -230,7 +230,7 @@ static void GetExtraPatches() {
} while (FindNextFile(hFind, &findData));
FindClose(hFind);
}
}
//}
// Remove first duplicates
size_t size = patchFiles.size();
for (size_t i = 1; i < size; ++i) {