mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 09:50:40 +08:00
fix(avatarcachemanager): avatar saved at wrong path in set_avatar()
m_save_path is empty & ::load() never called when cache folder does not exist.
This commit is contained in:
@@ -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<Config>::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<Config>::get_instance().load(full_path); \
|
||||
}
|
||||
|
||||
LogTraceFunction;
|
||||
|
||||
Reference in New Issue
Block a user