diff options
| author | click <none@none> | 2010-07-04 16:15:29 +0200 |
|---|---|---|
| committer | click <none@none> | 2010-07-04 16:15:29 +0200 |
| commit | cdf3514603e3d892ddf0d0b4be7d318e56274a5e (patch) | |
| tree | 7e400e518768895e55bd3eded1957cd261717809 | |
| parent | 079b945a7dff0dcc46d932ab929b7fe6c64c8c03 (diff) | |
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
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 11b8ce29763..ed3b4c6a5b4 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<Creature> 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(); |
