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
This commit is contained in:
@@ -622,10 +622,10 @@ class Creature : public Unit, public GridObject<Creature>
|
|||||||
bool hasInvolvedQuest(uint32 quest_id) const;
|
bool hasInvolvedQuest(uint32 quest_id) const;
|
||||||
|
|
||||||
bool isRegeneratingHealth() { return m_regenHealth; }
|
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
|
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;
|
return 0;
|
||||||
else
|
else
|
||||||
return m_charmInfo->GetCharmSpell(pos)->GetAction();
|
return m_charmInfo->GetCharmSpell(pos)->GetAction();
|
||||||
|
|||||||
Reference in New Issue
Block a user