aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Pet.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index 0cf0befb35d..cfa4d9a09f1 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -254,9 +254,14 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
// patch for old data where some spells have ACT_DECIDE but should have ACT_CAST
// so overwrite old state
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_charmInfo->GetActionBarEntry(index)->SpellOrAction);
- if (spellInfo && spellInfo->AttributesEx & SPELL_ATTR_EX_UNAUTOCASTABLE_BY_PET)
- m_charmInfo->GetActionBarEntry(index)->Type = ACT_DISABLED;
+ if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_charmInfo->GetActionBarEntry(index)->SpellOrAction))
+ {
+ if (spellInfo && spellInfo->AttributesEx & SPELL_ATTR_EX_UNAUTOCASTABLE_BY_PET)
+ m_charmInfo->GetActionBarEntry(index)->Type = ACT_DISABLED;
+
+ if(m_charmInfo->GetActionBarEntry(index)->Type == ACT_ENABLED)
+ ToggleAutocast(spellInfo->Id, true);
+ }
}
//init teach spells