Fix issue with adding spells via quest to an empty list

This commit is contained in:
Michael Cook (mackal) 2015-07-27 01:19:45 -04:00
parent 4258e5cebc
commit be459de555

View File

@ -2495,6 +2495,10 @@ void NPC::AddSpellToNPCList(int16 iPriority, int16 iSpellID, uint16 iType,
t.resist_adjust = iResistAdjust; t.resist_adjust = iResistAdjust;
AIspells.push_back(t); AIspells.push_back(t);
// If we're going from an empty list, we need to start the timer
if (AIspells.size() == 1)
AIautocastspell_timer->Start(RandomTimer(0, 15000), false);
} }
void NPC::RemoveSpellFromNPCList(int16 spell_id) void NPC::RemoveSpellFromNPCList(int16 spell_id)