mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 12:08:21 +08:00
Fix: Ensure fleet index before calling goto() (#1066)
This commit is contained in:
@@ -24,7 +24,7 @@ class Fleet(Camera, AmbushHandler):
|
|||||||
@property
|
@property
|
||||||
def fleet_1(self):
|
def fleet_1(self):
|
||||||
if self.fleet_current_index != 1:
|
if self.fleet_current_index != 1:
|
||||||
self.fleet_switch_to(index=1)
|
self.fleet_ensure(index=1)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@fleet_1.setter
|
@fleet_1.setter
|
||||||
@@ -35,7 +35,7 @@ class Fleet(Camera, AmbushHandler):
|
|||||||
def fleet_2(self):
|
def fleet_2(self):
|
||||||
if self.config.FLEET_2 and self.config.FLEET_BOSS == 2:
|
if self.config.FLEET_2 and self.config.FLEET_BOSS == 2:
|
||||||
if self.fleet_current_index != 2:
|
if self.fleet_current_index != 2:
|
||||||
self.fleet_switch_to(index=2)
|
self.fleet_ensure(index=2)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@fleet_2.setter
|
@fleet_2.setter
|
||||||
@@ -87,16 +87,19 @@ class Fleet(Camera, AmbushHandler):
|
|||||||
else:
|
else:
|
||||||
return self.config.Fleet_Fleet1Step
|
return self.config.Fleet_Fleet1Step
|
||||||
|
|
||||||
def fleet_switch_to(self, index):
|
def fleet_ensure(self, index):
|
||||||
self.fleet_set(index=index)
|
if self.fleet_set(index=index):
|
||||||
self.camera = self.fleet_current
|
self.camera = self.fleet_current
|
||||||
self.update()
|
self.update()
|
||||||
self.find_path_initial()
|
self.find_path_initial()
|
||||||
self.map.show_cost()
|
self.map.show_cost()
|
||||||
self.show_fleet()
|
self.show_fleet()
|
||||||
self.hp_get()
|
self.hp_get()
|
||||||
self.lv_get()
|
self.lv_get()
|
||||||
self.handle_strategy(index=self.fleet_current_index)
|
self.handle_strategy(index=self.fleet_current_index)
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
def switch_to(self):
|
def switch_to(self):
|
||||||
pass
|
pass
|
||||||
@@ -264,6 +267,7 @@ class Fleet(Camera, AmbushHandler):
|
|||||||
may_submarine_icon = may_submarine_icon and self.fleet_submarine_location == may_submarine_icon[0].location
|
may_submarine_icon = may_submarine_icon and self.fleet_submarine_location == may_submarine_icon[0].location
|
||||||
|
|
||||||
while 1:
|
while 1:
|
||||||
|
self.fleet_ensure(self.fleet_current_index)
|
||||||
self.in_sight(location, sight=self._walk_sight)
|
self.in_sight(location, sight=self._walk_sight)
|
||||||
self.focus_to_grid_center()
|
self.focus_to_grid_center()
|
||||||
grid = self.convert_global_to_local(location)
|
grid = self.convert_global_to_local(location)
|
||||||
|
|||||||
Reference in New Issue
Block a user