diff --git a/Source/utils/paths.cpp b/Source/utils/paths.cpp index 2505ce0f2..3104f0c47 100644 --- a/Source/utils/paths.cpp +++ b/Source/utils/paths.cpp @@ -3,6 +3,7 @@ #include #include "utils/stdcompat/optional.hpp" +#include "utils/file_util.h" #include "utils/log.hpp" #ifdef USE_SDL1 @@ -69,15 +70,23 @@ const std::string &BasePath() const std::string &PrefPath() { - if (!prefPath) + if (!prefPath) { prefPath = FromSDL(SDL_GetPrefPath("diasurgical", "devilution")); + if (FileExistsAndIsWriteable("diablo.ini")) { + prefPath = "./"; + } + } return *prefPath; } const std::string &ConfigPath() { - if (!configPath) + if (!configPath) { configPath = FromSDL(SDL_GetPrefPath("diasurgical", "devilution")); + if (FileExistsAndIsWriteable("diablo.ini")) { + configPath = "./"; + } + } return *configPath; }