style: for -> while

This commit is contained in:
zzyyyl
2022-06-21 23:06:57 +08:00
parent 6f8aa55dc9
commit 9b2d151f0e

View File

@@ -122,10 +122,11 @@ bool asst::AutoRecruitTask::calc_and_recruit()
{
LogTraceFunction;
int refresh_count = 0;
int maybe_level;
bool has_robot_tag;
for (int refresh_count = 0; ; ) {
while(true) {
RecruitCalcTask recruit_task(m_callback, m_callback_arg, m_task_chain);
recruit_task.set_param(m_select_level, true, m_skip_robot)
.set_retry_times(m_retry_times)
@@ -153,7 +154,7 @@ bool asst::AutoRecruitTask::calc_and_recruit()
&& !(m_skip_robot && has_robot_tag)) {
if (refresh()) {
// TODO: Add callback
if(++refresh_count > 3) {
if (++refresh_count > 3) {
// 按理来说不会到这里,因为超过三次刷新的时候上面的 recruit_task.get_has_refresh() 应该是 false
// 报个错,返回
callback(AsstMsg::SubTaskError, basic_info());