perf: 优化 DEBUG_skill_ready 判断

This commit is contained in:
uye
2026-05-02 00:40:06 +08:00
parent 0df451b7d9
commit 013c899d34
2 changed files with 8 additions and 5 deletions

View File

@@ -745,10 +745,13 @@ bool asst::BattleHelper::use_all_ready_skill(const cv::Mat& reusable)
// 识别到了,但点进去发现没有。一般来说是识别错了
if (!use_skill(loc, false)) {
Log.warn("Skill", name, "is not ready");
constexpr int MaxRetry = 3;
if (++retry >= MaxRetry) {
Log.warn("Do not use skill anymore", name);
usage = SkillUsage::NotUse;
static const bool save_infinitely = std::filesystem::exists("DEBUG_skill_ready.txt");
if (!save_infinitely) {
constexpr int MaxRetry = 3;
if (++retry >= MaxRetry) {
Log.warn("Do not use skill anymore", name);
usage = SkillUsage::NotUse;
}
}
continue;
}

View File

@@ -137,7 +137,7 @@ BattlefieldClassifier::SkillReadyResult BattlefieldClassifier::skill_ready_analy
.base_point = m_base_point,
};
const bool save_infinitely = std::filesystem::exists("DEBUG_skill_ready.txt");
static const bool save_infinitely = std::filesystem::exists("DEBUG_skill_ready.txt");
// 为重新训练模型截图
struct point_state