1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-13 06:47:00 +08:00

Fix: KeyError in convert_radar_to_local

This commit is contained in:
LmeSzinc
2021-09-06 20:40:11 +08:00
parent bb64d2f90e
commit 6d6b693795

View File

@@ -141,7 +141,14 @@ class OSCamera(OSMapOperation, Camera):
f'Assuming camera center is current fleet: {location2node(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)' % (
str(location),
location2node(local.location),