fix: 傀影肉鸽修复潜在的干员招募逻辑错误,并添加难度参数校验

This commit is contained in:
status102
2024-10-28 14:24:58 +08:00
parent e14a349968
commit 08b715a8eb

View File

@@ -20,7 +20,17 @@ bool asst::RoguelikeConfig::verify_and_load_params(const json::value& params)
m_theme = theme;
m_mode = mode;
m_difficulty = params.get("difficulty", 0);
if (m_theme != RoguelikeTheme::Phantom) {
m_difficulty = params.get("difficulty", 0);
}
else if (params.contains("difficulty")) {
Log.error(__FUNCTION__, "| Invalid difficulty for theme", m_theme);
return false;
}
else {
m_difficulty = 1;
}
m_start_with_elite_two = params.get("start_with_elite_two", false);
m_only_start_with_elite_two = params.get("only_start_with_elite_two", false);