fix: 修复保全retry_times不生效的问题

This commit is contained in:
MistEO
2023-01-17 02:48:17 +08:00
parent 08c38f5181
commit 7e77ae1efd
2 changed files with 4 additions and 3 deletions

View File

@@ -32,12 +32,12 @@ bool asst::SSSStageManagerTask::_run()
}
const std::string& stage_name = stage_opt.value();
int times = m_remaining_times[stage_name] + 1;
SSSBattleProcessTask battle_task(m_callback, m_inst, m_task_chain);
battle_task.set_stage_name(stage_name);
bool success = false;
int times = m_stage_try_times[stage_name];
for (int i = 0; i < times; ++i) {
Log.info("try to fight", i);
if (click_start_button() && battle_task.run() && !need_exit()) {
@@ -53,6 +53,7 @@ bool asst::SSSStageManagerTask::_run()
callback(AsstMsg::SubTaskExtraInfo, info);
settle();
break;
}
}
return true;
@@ -61,7 +62,7 @@ bool asst::SSSStageManagerTask::_run()
void asst::SSSStageManagerTask::preprocess_data()
{
for (const auto& [name, stage] : SSSCopilot.get_data().stages_data) {
m_remaining_times[name] = stage.retry_times;
m_stage_try_times[name] = stage.retry_times + 1;
}
}

View File

@@ -20,6 +20,6 @@ namespace asst
bool click_start_button();
bool settle(); // 结算奖励(退出整局保全战斗)
std::unordered_map<std::string, int> m_remaining_times;
std::unordered_map<std::string, int> m_stage_try_times;
};
}