From 350cfe354f1351bcd4620c14cc3d195b1aa52654 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Thu, 21 May 2026 22:58:48 +0800 Subject: [PATCH] Fix: Missing fleet2.in_use() when using Perseus skin (#5678) --- module/map/map_fleet_preparation.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/module/map/map_fleet_preparation.py b/module/map/map_fleet_preparation.py index 1edb78787..720e7301b 100644 --- a/module/map/map_fleet_preparation.py +++ b/module/map/map_fleet_preparation.py @@ -267,8 +267,17 @@ class FleetOperator: # Cropping FLEET_*_IN_USE to avoid detecting info_bar, also do the trick. # It also avoids wasting time on handling the info_bar. - image = rgb2gray(self.main.image_crop(self._in_use.button, copy=False)) - return np.std(image.flatten(), ddof=1) > self.FLEET_IN_USE_STD + image = self.main.image_crop(self._in_use.button, copy=False) + + # special fix for Perseus skin, which color is so flat + # https://github.com/LmeSzinc/AzurLaneAutoScript/issues/5678 + # no ship is in color (71, 70, 63) + color = cv2.mean(image)[:3] + if color_similar(color, (224, 154, 114), threshold=30): + return True + + gray = rgb2gray(image) + return np.std(gray.flatten(), ddof=1) > self.FLEET_IN_USE_STD def bar_opened(self): """