fix: 抗干扰值识别错误时卡树洞

#13572
This commit is contained in:
uye
2025-08-07 19:39:28 +08:00
parent 913bef8329
commit c97bed87f6
2 changed files with 5 additions and 21 deletions

View File

@@ -389,25 +389,6 @@
}
}
]
},
{
"name": "前行的林地",
"option_num": 2,
"choose": 1,
"choices": [
{
"name": "树上就不能走吗?",
"option_num": 2,
"choose": 1,
"requirements": [
{
"name": "Vision",
"type": ">",
"value": "0"
}
]
}
]
}
]
}

View File

@@ -102,9 +102,12 @@ std::optional<std::string> asst::RoguelikeStageEncounterTaskPlugin::handle_singl
analyzer.set_replace(Task.get<OcrTaskInfo>("NumberOcrReplace")->replace_map);
analyzer.set_use_char_model(true);
if (!analyzer.analyze()) {
return std::nullopt;
// return std::nullopt;
Log.error("Failed to recognize special value for event:", event.name);
}
else {
utils::chars_to_number(analyzer.get_result().front().text, special_val);
}
utils::chars_to_number(analyzer.get_result().front().text, special_val);
}
int choose_option = process_task(event, special_val);