diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index d84450bb5c..f74267a4ea 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -142,9 +142,13 @@ void PetAI::UpdateAI(uint32 diff) { TargetSpellList targetSpellStore; - for (uint8 i = 0; i < me->GetPetAutoSpellSize(); ++i) + for (uint8 i = ACTION_BAR_INDEX_START + 1; i < ACTION_BAR_INDEX_END; ++i) { - uint32 spellID = me->GetPetAutoSpellOnPos(i); + UnitActionBarEntry const* action = me->GetCharmInfo()->GetActionBarEntry(i); + if (!action || action->GetType() != ACT_ENABLED) + continue; + + uint32 spellID = action->GetAction(); if (!spellID) continue;