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
+6 -5
View File
@@ -382,12 +382,13 @@ Lua_Bot Lua_EntityList::GetBotByName(std::string bot_name) {
Lua_Bot_List Lua_EntityList::GetBotList() {
Lua_Safe_Call_Class(Lua_Bot_List);
Lua_Bot_List ret;
auto &bot_list = self->GetBotList();
if (bot_list.size()) {
for (auto bot : bot_list) {
ret.entries.emplace_back(Lua_Bot(bot));
}
auto &current_bot_list = self->GetBotList();
auto it = current_bot_list.begin();
while (it != current_bot_list.end()) {
ret.entries.emplace_back(it->second);
++it;
}
return ret;