[Crash] Fix Crash in FindType (#2867)

This commit is contained in:
Aeadoin 2023-02-13 01:15:40 -05:00 committed by GitHub
parent 4df9661903
commit b3fd9dd88a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5892,8 +5892,7 @@ uint16 Mob::GetSpellIDFromSlot(uint8 slot)
bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) {
int buff_count = GetMaxTotalSlots(); int buff_count = GetMaxTotalSlots();
for (int i = 0; i < buff_count; i++) { for (int i = 0; i < buff_count; i++) {
if (buffs[i].spellid != SPELL_UNKNOWN) { if (IsValidSpell(buffs[i].spellid)) {
for (int j = 0; j < EFFECT_COUNT; j++) { for (int j = 0; j < EFFECT_COUNT; j++) {
// adjustments necessary for offensive npc casting behavior // adjustments necessary for offensive npc casting behavior
if (bOffensive) { if (bOffensive) {