diff --git a/Source/utils/paths.cpp b/Source/utils/paths.cpp index c2f9b2341..c635531ac 100644 --- a/Source/utils/paths.cpp +++ b/Source/utils/paths.cpp @@ -91,7 +91,7 @@ const std::string &ConfigPath() const std::string &AssetsPath() { if (!assetsPath) - assetsPath.emplace(BasePath() + "assets/"); + assetsPath.emplace(FromSDL(SDL_GetBasePath()) + "assets/"); return *assetsPath; } @@ -118,6 +118,12 @@ void SetConfigPath(const std::string &path) AddTrailingSlash(*configPath); } +void SetAssetsPath(const std::string &path) +{ + assetsPath = path; + AddTrailingSlash(*assetsPath); +} + void SetMpqDir(const std::string &path) { mpqDir = std::string(path); diff --git a/Source/utils/paths.h b/Source/utils/paths.h index 1a933ac0e..b12bd5266 100644 --- a/Source/utils/paths.h +++ b/Source/utils/paths.h @@ -17,6 +17,7 @@ const std::optional &MpqDir(); void SetBasePath(const std::string &path); void SetPrefPath(const std::string &path); void SetConfigPath(const std::string &path); +void SetAssetsPath(const std::string &path); void SetMpqDir(const std::string &path); } // namespace paths