diff --git a/src/MaaCore/Config/ResourceLoader.cpp b/src/MaaCore/Config/ResourceLoader.cpp index 36b992c43d..8fa5306eb4 100644 --- a/src/MaaCore/Config/ResourceLoader.cpp +++ b/src/MaaCore/Config/ResourceLoader.cpp @@ -109,12 +109,13 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path) } \ } -#define LoadCacheWithoutRet(Config, Dir) \ - { \ - auto full_path = UserDir.get() / "cache"_p / Dir; \ - if (std::filesystem::exists(full_path)) { \ - SingletonHolder::get_instance().load(full_path); \ - } \ +#define LoadCacheWithoutRet(Config, Dir) \ + { \ + auto full_path = UserDir.get() / "cache"_p / Dir; \ + if (!std::filesystem::exists(full_path)) { \ + std::filesystem::create_directories(full_path); \ + } \ + SingletonHolder::get_instance().load(full_path); \ } LogTraceFunction;