*Fix a crash when toggle autocast for pet.
--HG-- branch : trunk
This commit is contained in:
+5
-7
@@ -233,6 +233,9 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
|||||||
CharacterDatabase.CommitTransaction();
|
CharacterDatabase.CommitTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_LoadSpells();
|
||||||
|
_LoadSpellCooldowns();
|
||||||
|
|
||||||
if(!is_temporary_summoned)
|
if(!is_temporary_summoned)
|
||||||
{
|
{
|
||||||
// permanent controlled pets store state in DB
|
// permanent controlled pets store state in DB
|
||||||
@@ -303,8 +306,6 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
|||||||
|
|
||||||
// Spells should be loaded after pet is added to map, because in CheckCast is check on it
|
// Spells should be loaded after pet is added to map, because in CheckCast is check on it
|
||||||
_LoadAuras(timediff);
|
_LoadAuras(timediff);
|
||||||
_LoadSpells();
|
|
||||||
_LoadSpellCooldowns();
|
|
||||||
LearnPetPassives();
|
LearnPetPassives();
|
||||||
CastPetAuras(current);
|
CastPetAuras(current);
|
||||||
|
|
||||||
@@ -1634,12 +1635,9 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
|||||||
if(IsPassiveSpell(spellid))
|
if(IsPassiveSpell(spellid))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//if(const SpellEntry *tempSpell = GetSpellStore()->LookupEntry(spellid))
|
|
||||||
// if(tempSpell->EffectImplicitTargetA[0] != TARGET_ALL_AROUND_CASTER
|
|
||||||
// && tempSpell->EffectImplicitTargetA[0] != TARGET_CHAIN_DAMAGE)
|
|
||||||
// return;
|
|
||||||
|
|
||||||
PetSpellMap::const_iterator itr = m_spells.find(spellid);
|
PetSpellMap::const_iterator itr = m_spells.find(spellid);
|
||||||
|
if(itr == m_spells.end())
|
||||||
|
return;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user