mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-13 03:35:51 +08:00
Fix: KeyError in convert_radar_to_local
This commit is contained in:
@@ -141,7 +141,14 @@ class OSCamera(OSMapOperation, Camera):
|
|||||||
f'Assuming camera center is current fleet: {location2node(self.view.center_loca)}')
|
f'Assuming camera center is current fleet: {location2node(self.view.center_loca)}')
|
||||||
center = self.view.center_loca
|
center = self.view.center_loca
|
||||||
|
|
||||||
local = self.view[np.add(location, center)]
|
try:
|
||||||
|
local = self.view[np.add(location, center)]
|
||||||
|
except KeyError:
|
||||||
|
logger.warning(f'Convert radar to local, but target grid not in local view. '
|
||||||
|
f'Assuming camera center is current fleet: {location2node(self.view.center_loca)}')
|
||||||
|
center = self.view.center_loca
|
||||||
|
local = self.view[np.add(location, center)]
|
||||||
|
|
||||||
logger.info('Radar %s -> Local %s (fleet=%s)' % (
|
logger.info('Radar %s -> Local %s (fleet=%s)' % (
|
||||||
str(location),
|
str(location),
|
||||||
location2node(local.location),
|
location2node(local.location),
|
||||||
|
|||||||
Reference in New Issue
Block a user