From a40b9d69fd5a88f41c09808ce03b64deb38772d7 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Thu, 30 May 2024 20:26:45 +0800 Subject: [PATCH] Fix: Update obtain_frequent_check before deside again or exit --- tasks/combat/combat.py | 2 ++ tasks/combat/obtain.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tasks/combat/combat.py b/tasks/combat/combat.py index 019d113ff..a15477dff 100644 --- a/tasks/combat/combat.py +++ b/tasks/combat/combat.py @@ -296,6 +296,8 @@ class Combat(CombatInteract, CombatPrepare, CombatState, CombatTeam, CombatSuppo # Game client might slow to response COMBAT_AGAIN clicks if self.appear(COMBAT_AGAIN, interval=5): add_wave_done() + # Update obtain_frequent_check + self.obtained_is_full(dungeon=self.dungeon, wave_done=self.combat_wave_done, obtain_get=False) # Cache the result of _combat_can_again() as no expected stamina reduce during retry if combat_can_again is None: combat_can_again = self._combat_can_again() diff --git a/tasks/combat/obtain.py b/tasks/combat/obtain.py index 50f941b87..2f5799fc2 100644 --- a/tasks/combat/obtain.py +++ b/tasks/combat/obtain.py @@ -253,7 +253,7 @@ class CombatObtain(PlannerMixin): self.planner_write() return items - def obtained_is_full(self, dungeon: DungeonList | None, wave_done=0) -> bool: + def obtained_is_full(self, dungeon: DungeonList | None, wave_done=0, obtain_get=True) -> bool: if dungeon is None: self.obtain_frequent_check = False return False @@ -263,7 +263,8 @@ class CombatObtain(PlannerMixin): return False # Update - self.obtain_get(dungeon) + if obtain_get: + self.obtain_get(dungeon) # Check progress row = self.planner.row_come_from_dungeon(dungeon)