mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 07:28:21 +08:00
Opt: Check total ap to prevent meaningless ap box usage (#4020)
* Fix: predict_enemy_genre in event_20220526_cn rerun (#4005) * Opt: Check total ap to prevent meaningless ap box usage --------- Co-authored-by: LmeSzinc <lmeszincsales@gmail.com> Co-authored-by: Air111 <54128005+Air111@users.noreply.github.com>
This commit is contained in:
@@ -376,10 +376,18 @@ class ActionPointHandler(UI, MapEventHandler):
|
|||||||
# Buy action points
|
# Buy action points
|
||||||
if self.config.OpsiGeneral_BuyActionPointLimit > 0 and not buy_checked:
|
if self.config.OpsiGeneral_BuyActionPointLimit > 0 and not buy_checked:
|
||||||
if self.action_point_buy(preserve=self.config.OpsiGeneral_OilLimit):
|
if self.action_point_buy(preserve=self.config.OpsiGeneral_OilLimit):
|
||||||
|
self.action_point_safe_get()
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
buy_checked = True
|
buy_checked = True
|
||||||
|
|
||||||
|
# Recheck if total ap is less than cost
|
||||||
|
# If it is, skip using boxes
|
||||||
|
if self._action_point_total < cost:
|
||||||
|
logger.info('Not having enough action points')
|
||||||
|
self.action_point_quit()
|
||||||
|
raise ActionPointLimit
|
||||||
|
|
||||||
# Sort action point boxes
|
# Sort action point boxes
|
||||||
box = []
|
box = []
|
||||||
for index in [1, 2, 3]:
|
for index in [1, 2, 3]:
|
||||||
|
|||||||
Reference in New Issue
Block a user