mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-08 12:27:33 +08:00
Fix: Handle empty HP when using emergency repair (#2925)
This commit is contained in:
parent
881007979a
commit
f948fd502f
@ -203,7 +203,9 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
logger.info('EMERGENCY_REPAIR_AVAILABLE')
|
||||
if not len(self.hp):
|
||||
return False
|
||||
if np.min(np.array(self.hp)[np.array(self.hp) > 0.001]) < self.config.HpControl_RepairUseSingleThreshold \
|
||||
hp = np.array(self.hp)
|
||||
hp = hp[hp > 0.001]
|
||||
if (len(hp) and np.min(hp) < self.config.HpControl_RepairUseSingleThreshold) \
|
||||
or np.max(self.hp[:3]) < self.config.HpControl_RepairUseMultiThreshold \
|
||||
or np.max(self.hp[3:]) < self.config.HpControl_RepairUseMultiThreshold:
|
||||
logger.info('Use emergency repair')
|
||||
|
@ -332,6 +332,9 @@ class Fleet(Camera, AmbushHandler):
|
||||
|
||||
if self.catch_camera_repositioning(self.map[location]):
|
||||
self.handle_boss_appear_refocus()
|
||||
if sum(self.hp) < 0.01:
|
||||
logger.warning('Empty HP on all slots, trying hp_get again')
|
||||
self.hp_get()
|
||||
if self.config.MAP_FOCUS_ENEMY_AFTER_BATTLE:
|
||||
self.camera = location
|
||||
self.update()
|
||||
|
Loading…
Reference in New Issue
Block a user