feat.自动战斗新增支持按location撤退(尽量少使用)

This commit is contained in:
MistEO
2022-05-29 04:40:44 +08:00
parent f8f8a2657a
commit 9fe8f5dff5

View File

@@ -443,17 +443,18 @@ bool asst::BattleProcessTask::oper_deploy(const BattleAction& action)
bool asst::BattleProcessTask::oper_retreat(const BattleAction& action)
{
const std::string& name = m_group_to_oper_mapping[action.group_name].name;
auto iter = m_used_opers.find(name);
if (iter == m_used_opers.cend()) {
Log.error(name, " not used");
return false;
Point pos;
if (auto iter = m_used_opers.find(name);
iter != m_used_opers.cend()) {
pos = iter->second.pos;
m_used_opers.erase(name);
}
else {
pos = m_normal_tile_info.at(action.location).pos;
}
Point pos = iter->second.pos;
m_ctrler->click(pos);
sleep(Task.get("BattleUseOper")->pre_delay);
m_used_opers.erase(name);
return ProcessTask(*this, { "BattleOperRetreat" }).run();
}