[Tasks] Implement Task Goal Match List (#2097)

* [Tasks] Implement Task Goal Match List

* Migration

* Add npc_type_id to match types for npc kill

* Flip str_tolower
This commit is contained in:
Chris Miles
2022-05-07 15:37:06 -05:00
committed by GitHub
parent dca34cc2ff
commit 862e1e33bf
11 changed files with 84 additions and 26 deletions
+23
View File
@@ -147,3 +147,26 @@ bool TaskGoalListManager::IsInList(int list_id, int entry)
return true;
}
bool TaskGoalListManager::IsInMatchList(const std::string& match_list, const std::string& entry)
{
for (auto &s: SplitString(match_list, '|')) {
if (s == entry) {
return true;
}
}
return false;
}
bool TaskGoalListManager::IsInMatchListPartial(const std::string &match_list, const std::string &entry)
{
std::string entry_match = str_tolower(entry);
for (auto &s: SplitString(match_list, '|')) {
if (entry_match.find(str_tolower(s)) != std::string::npos) {
return true;
}
}
return false;
}