mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 10:10:45 +08:00
fix: RoguelikeFoldartalGainTaskPlugin::gain_stage_award || 链恒为 true 导致装备误入密文板列表; correct_rect计算顺序
```cpp
if (foldartal != "雷达" || "留声机" || "景观" || "LUD" || "踢脚" || "自走车")
```
C++ 把这串解析成 `(foldartal != "雷达") || ("留声机") || ("景观") || ...`,
后面 5 个字符串字面量是 `const char*`,非空指针视为 `true`,整个表达式恒真。
注释 `// 深入调查调查装备也使用同一个入口,先分类` 已经说明意图是排除这 6
个装备名,不让它们被 `gain_foldartal` 当密文板存入 `foldartal_list`。
不是游戏机制:这 6 个名字是萨米肉鸽"深入调查"事件的装备奖励(不是密文板),
跟密文板使用流程不应该混在一起;注释自陈"先分类"明确意图是过滤,
不是有意把所有 OCR 文字都收进来。
改成 `&&` 链做逐项排除。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: fireflysentinel <phoenix1203@uchicago.edu>
This commit is contained in:
committed by
status102
parent
cfa3fedb0c
commit
ef0e4958bf
@@ -122,7 +122,8 @@ bool asst::RoguelikeFoldartalGainTaskPlugin::gain_stage_award()
|
||||
|
||||
auto foldartal = analyzer.get_result().front().text;
|
||||
// 深入调查调查装备也使用同一个入口,先分类
|
||||
if (foldartal != "雷达" || "留声机" || "景观" || "LUD" || "踢脚" || "自走车") {
|
||||
if (foldartal != "雷达" && foldartal != "留声机" && foldartal != "景观" && foldartal != "LUD"
|
||||
&& foldartal != "踢脚" && foldartal != "自走车") {
|
||||
gain_foldartal(std::move(foldartal));
|
||||
}
|
||||
if (m_ocr_after_combat) {
|
||||
|
||||
@@ -64,12 +64,12 @@ Rect asst::VisionHelper::correct_rect(const Rect& rect, const Rect& main_roi)
|
||||
res.height = rect.height + rect.y;
|
||||
}
|
||||
if (res.x < main_roi.x) {
|
||||
res.x = main_roi.x;
|
||||
res.width = res.width - (main_roi.x - res.x);
|
||||
res.x = main_roi.x;
|
||||
}
|
||||
if (res.y < main_roi.y) {
|
||||
res.y = main_roi.y;
|
||||
res.height = res.height - (main_roi.y - res.y);
|
||||
res.y = main_roi.y;
|
||||
}
|
||||
if (res.x + res.width > main_roi.x + main_roi.width) {
|
||||
res.width = main_roi.x + main_roi.width - res.x;
|
||||
|
||||
Reference in New Issue
Block a user