diff --git a/3rdparty/include/Arknights-Tile-Pos/TileDef.hpp b/3rdparty/include/Arknights-Tile-Pos/TileDef.hpp index 5f496855e1..31dbc632e7 100644 --- a/3rdparty/include/Arknights-Tile-Pos/TileDef.hpp +++ b/3rdparty/include/Arknights-Tile-Pos/TileDef.hpp @@ -23,10 +23,10 @@ struct LevelKey } matched = true; } - return true; + return true; // ignore this property if rhs is empty } - bool operator==(const LevelKey& other) const noexcept + bool match(const LevelKey& other) const noexcept { bool has_non_empty_match = false; return check_and_track(stageId, other.stageId, has_non_empty_match) && @@ -35,7 +35,7 @@ struct LevelKey check_and_track(name, other.name, has_non_empty_match) && has_non_empty_match; } - bool operator==(const std::string& any_key) const noexcept + bool match(const std::string& any_key) const noexcept { if (any_key.empty()) { return false; diff --git a/src/MaaCore/Config/Miscellaneous/TilePack.h b/src/MaaCore/Config/Miscellaneous/TilePack.h index 74ae5f7cf5..d792833b9c 100644 --- a/src/MaaCore/Config/Miscellaneous/TilePack.h +++ b/src/MaaCore/Config/Miscellaneous/TilePack.h @@ -71,7 +71,7 @@ public: std::optional find(const KeyT& key) const { for (const auto& pair : m_summarize) { - if (pair.first == key) { + if (pair.first.match(key)) { return pair; } }