From 3a485c658d9003aaaa4bd8e99dfebb9e7f0ec862 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 28 Mar 2009 22:05:12 -0600 Subject: *Fix a bug that pet does not toggle autocast when loaded. --HG-- branch : trunk --- src/game/Pet.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/game/Pet.cpp') 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 -- cgit v1.2.3