fix: 修复无法对后续加载的图片资源进行存在检测的错误,跳过宿舍技能检查

This commit is contained in:
status102
2023-10-04 11:54:48 +08:00
parent ae517e70bb
commit caa353cc53
3 changed files with 6 additions and 2 deletions

View File

@@ -26,7 +26,10 @@ bool asst::InfrastConfig::parse(const json::value& json)
infrast::Skill skill;
std::string templ_name = skill_json.at("template").as_string();
skill.templ_name = templ_name;
m_templ_required.emplace(skill.templ_name);
if (!templ_name.starts_with("Bskill_dorm_")) {
// 宿舍技能跳过,没有图片
m_templ_required.emplace(skill.templ_name);
}
skill.id = id;
for (const json::value& skill_names : skill_json.at("name").as_array()) {
skill.names.emplace_back(skill_names.as_string());

View File

@@ -153,6 +153,7 @@ bool asst::ResourceLoader::load(const std::filesystem::path& path)
// 重要的资源,实时加载(图片还是惰性的)
LoadResourceWithTemplAndCheckRet(TaskData, "tasks.json"_p, "template"_p);
// 基建技能路径,无法变更(基于热更屎山)
LoadResourceWithTemplAndCheckRet(InfrastConfig, "infrast.json"_p, "template"_p / "infrast"_p);
LoadResourceWithTemplAndCheckRet(ItemConfig, "item_index.json"_p, "template"_p / "items"_p);

View File

@@ -34,7 +34,7 @@ bool asst::TemplResource::load(const std::filesystem::path& path)
m_templ_paths.insert_or_assign(name, filepath);
}
}
else if (m_loaded) {
else if (m_loaded && m_templ_paths.contains(name)) {
continue;
}
else {