aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellEffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/SpellEffects.cpp')
-rw-r--r--src/game/SpellEffects.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 7ae64d2129f..af17bf0f97e 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -3236,7 +3236,7 @@ void Spell::EffectSummon(uint32 i)
Pet* spawnCreature = new Pet(SUMMON_PET);
spawnCreature->setActive(m_caster->isActive());
- if(spawnCreature->LoadPetFromDB(m_caster,pet_entry))
+ if(m_caster->GetTypeId()==TYPEID_PLAYER && spawnCreature->LoadPetFromDB((Player*)m_caster,pet_entry))
{
// set timer for unsummon
int32 duration = GetSpellDuration(m_spellInfo);
@@ -4106,7 +4106,7 @@ void Spell::EffectSummonPet(uint32 i)
NewSummon->setActive(m_caster->isActive());
// petentry==0 for hunter "call pet" (current pet summoned if any)
- if(NewSummon->LoadPetFromDB(m_caster,petentry))
+ if(m_caster->GetTypeId() == TYPEID_PLAYER && NewSummon->LoadPetFromDB((Player*)m_caster,petentry))
{
if(NewSummon->getPetType()==SUMMON_PET)
{
@@ -4191,7 +4191,8 @@ void Spell::EffectSummonPet(uint32 i)
// this enables pet details window (Shift+P)
// this enables popup window (pet dismiss, cancel), hunter pet additional flags set later
- NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
+ if(m_caster->GetTypeId() == TYPEID_PLAYER)
+ NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
NewSummon->InitStatsForLevel(petlevel);
NewSummon->InitPetCreateSpells();
@@ -5471,7 +5472,9 @@ void Spell::EffectSummonTotem(uint32 i)
}
pTotem->SetUInt32Value(UNIT_CREATED_BY_SPELL,m_spellInfo->Id);
- pTotem->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
+
+ if(m_caster->GetTypeId() == TYPEID_PLAYER)
+ pTotem->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
pTotem->ApplySpellImmune(m_spellInfo->Id,IMMUNITY_STATE,SPELL_AURA_MOD_FEAR,true);
pTotem->ApplySpellImmune(m_spellInfo->Id,IMMUNITY_STATE,SPELL_AURA_TRANSFORM,true);