diff --git a/Source/utils/paths.cpp b/Source/utils/paths.cpp index cdf6a69c581..e7157cdbc9a 100644 --- a/Source/utils/paths.cpp +++ b/Source/utils/paths.cpp @@ -118,13 +118,13 @@ const std::string &ConfigPath() const std::string &AssetsPath() { + if (!assetsPath) { #if defined(__HAIKU__) - char buffer[B_PATH_NAME_LENGTH+10]; - find_directory(B_SYSTEM_DATA_DIRECTORY, dev_for_path("/boot"), false, buffer, B_PATH_NAME_LENGTH); - strcat(buffer, "/devilutionx/"); - assetsPath.emplace(strdup(buffer)); + char buffer[B_PATH_NAME_LENGTH+10]; + find_directory(B_SYSTEM_DATA_DIRECTORY, dev_for_path("/boot"), false, buffer, B_PATH_NAME_LENGTH); + strcat(buffer, "/devilutionx/"); + assetsPath.emplace(strdup(buffer)); #endif - if (!assetsPath) { #if __EMSCRIPTEN__ assetsPath.emplace("assets/"); #elif defined(NXDK)