From a39a7d95f6b9fadc391fd8b53e494b25536470e9 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Mon, 26 Aug 2024 22:42:05 +0800 Subject: [PATCH] Fix: Handle combat_waves <= 0 in _combat_can_again --- tasks/combat/combat.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/combat/combat.py b/tasks/combat/combat.py index 8d102973d..cf05487c6 100644 --- a/tasks/combat/combat.py +++ b/tasks/combat/combat.py @@ -220,6 +220,9 @@ class Combat(CombatInteract, CombatPrepare, CombatState, CombatTeam, CombatSuppo if self.obtain_frequent_check: logger.info('Exit combat to check obtained items') return False + if self.combat_waves <= 0: + logger.warning(f'combat_waves {self.combat_waves} <= 0 in _combat_can_again, revise to 1') + self.combat_waves = 1 # Wave limit if self.combat_wave_limit: if self.combat_wave_done + self.combat_waves > self.combat_wave_limit: