Browse Source

if Writeable diablo.ini in PWD use that and save saves to PWD

pull/1984/head
Trihedraf 5 years ago committed by Anders Jenbo
parent
commit
de3f30623b
  1. 13
      Source/utils/paths.cpp

13
Source/utils/paths.cpp

@ -3,6 +3,7 @@
#include <SDL.h>
#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;
}

Loading…
Cancel
Save