From bf5f8fd3c7a000dbe0ef42c43b988ae058726e95 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:13:14 +0800 Subject: [PATCH] Fix: COMBAT_TEAM_SUPPORT is clicked before support_set() --- tasks/combat/combat.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tasks/combat/combat.py b/tasks/combat/combat.py index ab97419ce..9767615cd 100644 --- a/tasks/combat/combat.py +++ b/tasks/combat/combat.py @@ -81,7 +81,15 @@ class Combat(CombatInteract, CombatPrepare, CombatState, CombatTeam, CombatSuppo """ logger.hr('Combat prepare') skip_first_screenshot = True - pre_set_team = bool(support_character) + if support_character: + # To set team before support set + pre_set_team = True + # Block COMBAT_TEAM_PREPARE before support set + support_set = False + else: + pre_set_team = False + support_set = True + logger.info([support_character, pre_set_team, support_set]) trial = 0 while 1: if skip_first_screenshot: @@ -99,14 +107,15 @@ class Combat(CombatInteract, CombatPrepare, CombatState, CombatTeam, CombatSuppo raise RequestHumanTakeover # Click - if self.appear(COMBAT_TEAM_SUPPORT) and support_character: + if support_character and self.appear(COMBAT_TEAM_SUPPORT): if pre_set_team: self.team_set(team) pre_set_team = False continue self.support_set(support_character) + support_set = True continue - if self.appear(COMBAT_TEAM_PREPARE, interval=2): + if support_set and self.appear(COMBAT_TEAM_PREPARE, interval=2): self.team_set(team) self.device.click(COMBAT_TEAM_PREPARE) self.interval_reset(COMBAT_TEAM_PREPARE)