From cdf3514603e3d892ddf0d0b4be7d318e56274a5e Mon Sep 17 00:00:00 2001 From: click Date: Sun, 4 Jul 2010 16:15:29 +0200 Subject: [PATCH] Use MAX_SPELL_CHARM as spellcount on GetPetAutoSpellSize(), fixes OOB array-access in Pet::UpdateAI() Thanks to ge0rg for the heads up and patch --HG-- branch : trunk --- src/server/game/Entities/Creature/Creature.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 11b8ce2976..ed3b4c6a5b 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -622,10 +622,10 @@ class Creature : public Unit, public GridObject bool hasInvolvedQuest(uint32 quest_id) const; bool isRegeneratingHealth() { return m_regenHealth; } - virtual uint8 GetPetAutoSpellSize() const { return CREATURE_MAX_SPELLS; } + virtual uint8 GetPetAutoSpellSize() const { return MAX_SPELL_CHARM; } virtual uint32 GetPetAutoSpellOnPos(uint8 pos) const { - if (pos >= CREATURE_MAX_SPELLS || m_charmInfo->GetCharmSpell(pos)->GetType() != ACT_ENABLED) + if (pos >= MAX_SPELL_CHARM || m_charmInfo->GetCharmSpell(pos)->GetType() != ACT_ENABLED) return 0; else return m_charmInfo->GetCharmSpell(pos)->GetAction();