fix.修复自动战斗不能放技能的问题,并修复拖动速度

This commit is contained in:
MistEO
2022-06-07 02:17:44 +08:00
parent ed36032af6
commit b70caf29da
3 changed files with 5 additions and 5 deletions

View File

@@ -454,7 +454,7 @@ bool asst::BattleProcessTask::oper_deploy(const BattleAction& action)
std::sqrt(
(std::abs(placed_point.x - oper_rect.x) << 1)
+ (std::abs(placed_point.y - oper_rect.y) << 1)));
int duration = static_cast<int>(swipe_oper_task_ptr->pre_delay / 500.0 * dist); // 随便取的一个系数
int duration = static_cast<int>(swipe_oper_task_ptr->pre_delay / 1000 * dist); // 随便取的一个系数
m_ctrler->swipe(oper_rect, placed_rect, duration, true, 0);
sleep(use_oper_task_ptr->rear_delay);
@@ -503,7 +503,7 @@ bool asst::BattleProcessTask::oper_retreat(const BattleAction& action)
const std::string& name = m_group_to_oper_mapping[action.group_name].name;
Point pos;
if (auto iter = m_used_opers.find(name);
action.location.x != 0 && action.location.y != 0 &&
action.location.x == 0 && action.location.y == 0 &&
iter != m_used_opers.cend()) {
pos = iter->second.pos;
m_used_opers.erase(name);
@@ -522,7 +522,7 @@ bool asst::BattleProcessTask::use_skill(const BattleAction& action)
const std::string& name = m_group_to_oper_mapping[action.group_name].name;
Point pos;
if (auto iter = m_used_opers.find(name);
action.location.x != 0 && action.location.y != 0 &&
action.location.x == 0 && action.location.y == 0 &&
iter != m_used_opers.cend()) {
pos = iter->second.pos;
m_used_opers.erase(name);