[Bug Fix] Fix #findaa and GetAAName(). (#2774)

# Notes
- These were not properly checking every possible AA ID.
This commit is contained in:
Alex King 2023-01-22 12:56:49 -05:00 committed by GitHub
parent d0edb93d62
commit 0a11eaa092
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -35,7 +35,7 @@ void command_findaa(Client *c, const Seperator *sep)
std::map<int, std::string> ordered_aas; std::map<int, std::string> ordered_aas;
for (const auto& a : zone->aa_abilities) { for (const auto& a : zone->aa_abilities) {
ordered_aas[a.second.get()->id] = a.second.get()->name; ordered_aas[a.second.get()->first->id] = a.second.get()->name;
} }
int found_count = 0; int found_count = 0;

View File

@ -2984,6 +2984,12 @@ std::string Zone::GetAAName(int aa_id)
const auto& a = aa_abilities.find(current_aa_id); const auto& a = aa_abilities.find(current_aa_id);
if (a != aa_abilities.end()) { if (a != aa_abilities.end()) {
return a->second.get()->name; return a->second.get()->name;
} else {
for (const auto& b : aa_abilities) {
if (b.second.get()->first->id == aa_id) {
return b.second.get()->name;
}
}
} }
} }