Move bot_list from std::list to std::unordered_map like other entities

This commit is contained in:
nytmyr
2024-12-23 20:50:36 -06:00
parent c7741efbe5
commit ef983c3d47
53 changed files with 266 additions and 275 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ void bot_command_attack(Client *c, const Seperator *sep)
class_race_check = true;
}
std::list<Bot*> sbl;
std::vector<Bot*> sbl;
if (ActionableBots::PopulateSBL(c, ab_arg.c_str(), sbl, ab_mask, !class_race_check ? sep->arg[2] : nullptr, class_race_check ? atoi(sep->arg[2]) : 0) == ActionableBots::ABT_None) {
return;
@@ -47,7 +47,7 @@ void bot_command_attack(Client *c, const Seperator *sep)
size_t attacker_count = 0;
Bot *first_attacker = nullptr;
sbl.remove(nullptr);
sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end());
for (auto bot_iter : sbl) {
if (bot_iter->GetAppearance() != eaDead && bot_iter->GetBotStance() != Stance::Passive) {