mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
[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:
parent
4df9fa89bc
commit
933293098b
@ -1225,13 +1225,12 @@ bool BotDatabase::LoadItemSlots(const uint32 bot_id, std::map<uint16, uint32>& m
|
||||
bot_id
|
||||
)
|
||||
);
|
||||
if (l.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!l.empty()) {
|
||||
for (const auto& e : l) {
|
||||
m.insert(std::pair<uint16, uint32>(e.slot_id, e.item_id));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3286,10 +3286,8 @@ DBbotspells_Struct* ZoneDatabase::GetBotSpells(uint32 bot_spell_id)
|
||||
bot_spell_id
|
||||
)
|
||||
);
|
||||
if (bse.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!bse.empty()) {
|
||||
for (const auto& e : bse) {
|
||||
DBbotspells_entries_Struct entry;
|
||||
entry.spellid = e.spellid;
|
||||
@ -3319,6 +3317,7 @@ DBbotspells_Struct* ZoneDatabase::GetBotSpells(uint32 bot_spell_id)
|
||||
|
||||
spell_set.entries.push_back(entry);
|
||||
}
|
||||
}
|
||||
|
||||
bot_spells_cache.insert(std::make_pair(bot_spell_id, spell_set));
|
||||
|
||||
@ -3444,7 +3443,6 @@ void Bot::AI_Bot_Event_SpellCastFinished(bool iCastSucceeded, uint16 slot) {
|
||||
}
|
||||
|
||||
bool Bot::HasBotSpellEntry(uint16 spellid) {
|
||||
|
||||
auto* spell_list = content_db.GetBotSpells(GetBotSpellID());
|
||||
|
||||
if (!spell_list) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user