diff options
-rw-r--r-- | src/game/SpellEffects.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 6d16cba265b..ed85d0767c5 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6601,13 +6601,17 @@ void Spell::EffectReputation(uint32 i) void Spell::EffectQuestComplete(uint32 i) { - if(m_caster->GetTypeId() != TYPEID_PLAYER) - return; + Player *pPlayer; - Player *_player = (Player*)m_caster; + if (m_caster->GetTypeId() == TYPEID_PLAYER) + pPlayer = (Player*)m_caster; + else if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER) + pPlayer = (Player*)unitTarget; + else + return; uint32 quest_id = m_spellInfo->EffectMiscValue[i]; - _player->AreaExploredOrEventHappens(quest_id); + pPlayer->AreaExploredOrEventHappens(quest_id); } void Spell::EffectForceDeselect(uint32 i) |