Skip to content

Commit

Permalink
Fix: check_reduce in GemsFarming
Browse files Browse the repository at this point in the history
  • Loading branch information
guoh064 committed Sep 15, 2024
1 parent 1d30b63 commit d2a474e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions module/campaign/gems_farming.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ def check_reduce(self, battle):
Raise:
CampaignEnd: Pause current task to prevent emotion control in the future.
"""

try:
super().check_reduce(battle)
except ScriptEnd:
if not self.is_calculate:
return

recovered, delay = self._check_reduce(battle)
if delay:
self.config.GEMS_EMOTION_TRIGGERED = True
self.config.task_delay(minute=0) # to undo emotion delay
logger.info('Detect low emotion, pause current task')
raise CampaignEnd('Emotion control')

def wait(self, fleet_index):
Expand Down

0 comments on commit d2a474e

Please sign in to comment.