Fix: Catch ScriptEnd raised from emotion control

This commit is contained in:
LmeSzinc 2023-03-24 13:40:39 +08:00
parent b1fe0e32e2
commit 9a1e76c366

View File

@ -3,7 +3,7 @@ import re
from module.campaign.campaign_event import CampaignEvent
from module.coalition.assets import *
from module.coalition.combat import CoalitionCombat
from module.exception import ScriptError
from module.exception import ScriptError, ScriptEnd
from module.logger import logger
from module.ocr.ocr import Digit
@ -118,7 +118,12 @@ class Coalition(CoalitionCombat, CampaignEvent):
break
# Run
self.coalition_execute_once(event=name, stage=stage, fleet=fleet)
try:
self.coalition_execute_once(event=name, stage=stage, fleet=fleet)
except ScriptEnd as e:
logger.hr('Script end')
logger.info(str(e))
break
# After run
self.run_count += 1