Skip to content

Commit

Permalink
NPCBots: Fix regression from 5ff85f0
Browse files Browse the repository at this point in the history
  • Loading branch information
trickerer committed May 21, 2024
1 parent e5b2110 commit 72e2f1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/server/game/AI/NpcBots/bot_ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ void bot_ai::ResetBotAI(uint8 resetType)

if ((resetType == BOTAI_RESET_DISMISS || resetType == BOTAI_RESET_LOGOUT) && !IsTempBot())
{
EnableAllSpells();
EnableAllSpells(resetType == BOTAI_RESET_DISMISS);
InitRoles();
}

Expand Down Expand Up @@ -6850,11 +6850,14 @@ void bot_ai::RemoveSpell(uint32 basespell)
// for (BotSpellMap::const_iterator itr = _spells.begin(); itr != _spells.end(); ++itr)
// itr->second->spellId = 0;
//}
void bot_ai::EnableAllSpells()
void bot_ai::EnableAllSpells(bool save)
{
NpcBotData* npcBotData = const_cast<NpcBotData*>(BotDataMgr::SelectNpcBotData(me->GetEntry()));
npcBotData->disabled_spells.clear();
_saveDisabledSpells = true;
if (save)
{
NpcBotData* npcBotData = const_cast<NpcBotData*>(BotDataMgr::SelectNpcBotData(me->GetEntry()));
npcBotData->disabled_spells.clear();
_saveDisabledSpells = true;
}

for (BotSpellMap::const_iterator itr = _spells.begin(); itr != _spells.end(); ++itr)
if (itr->second->enabled == false)
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/AI/NpcBots/bot_ai.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class bot_ai : public CreatureAI
void ResetSpellCooldown(uint32 basespell) { SetSpellCooldown(basespell, 0); }
void RemoveSpell(uint32 basespell);
//void RemoveAllSpells();
void EnableAllSpells();
void EnableAllSpells(bool save);
void SpellTimers(uint32 diff);
static uint32 RaceSpellForClass(uint8 myrace, uint8 myclass);

Expand Down

0 comments on commit 72e2f1f

Please sign in to comment.