Skip to content

Commit 3b14207

Browse files
authored
fix: decisive shipname patch (#448)
* fix: apply_ship_patches * fix ship choose logic
1 parent 7345dab commit 3b14207

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

autowsgr/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""AutoWSGR - 战舰少女R 自动化框架(v2)"""
22

3-
__version__ = '2.1.9.post8'
3+
__version__ = '2.1.9.post9'

autowsgr/ops/decisive/logic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def choose_ships(
114114
candidates = self.config.level1 + [e for e in self._level2_full if not _is_ship(e)]
115115

116116
lim = 6 if fleet_count < 6 else score
117+
lim = score if fleet_count == 0 else lim
117118
result: list[str] = []
118119
for target in candidates:
119120
if target in selections:

autowsgr/ui/utils/ship_list.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from autowsgr.constants import SHIPNAMES
1515
from autowsgr.infra.logger import get_logger
16-
from autowsgr.vision import get_api_dll
16+
from autowsgr.vision import apply_ship_patches, get_api_dll
1717
from autowsgr.vision.ocr import _fuzzy_match
1818

1919

@@ -135,7 +135,8 @@ def locate_ship_rows(
135135
text = r.text.strip()
136136
if not text:
137137
continue
138-
name = _fuzzy_match(text, SHIPNAMES)
138+
correct_name = apply_ship_patches(text)
139+
name = _fuzzy_match(correct_name, SHIPNAMES)
139140
if name is None:
140141
continue
141142
if deduplicate_by_name and name in seen:
@@ -393,7 +394,8 @@ def read_ship_levels(
393394
if level is not None:
394395
local_level_hits.append((level, x_center))
395396

396-
name = _fuzzy_match(text, SHIPNAMES)
397+
correct_name = apply_ship_patches(text)
398+
name = _fuzzy_match(correct_name, SHIPNAMES)
397399
if name is not None:
398400
name_hits.append((name, x_center))
399401

0 commit comments

Comments
 (0)