[Bug Fix] Fix Bot "Failed to Load" Messages. (#2719)

* [Bug Fix] Fix Bot "Failed to Load" Messages.

# Notes
- Bots were producing error messages for "failing to load" spells and inventory when the bot had no spells, like a Warrior, or when the bot was naked, like a newly created bot.

* Update botspellsai.cpp
This commit is contained in:
Alex King
2023-01-10 21:45:04 -05:00
committed by GitHub
parent 4df9fa89bc
commit 933293098b
2 changed files with 37 additions and 40 deletions
+4 -5
View File
@@ -1225,12 +1225,11 @@ bool BotDatabase::LoadItemSlots(const uint32 bot_id, std::map<uint16, uint32>& m
bot_id
)
);
if (l.empty()) {
return false;
}
for (const auto& e : l) {
m.insert(std::pair<uint16, uint32>(e.slot_id, e.item_id));
if (!l.empty()) {
for (const auto& e : l) {
m.insert(std::pair<uint16, uint32>(e.slot_id, e.item_id));
}
}
return true;