From e68c149e6909545a61f0400fbebcafa28d44069e Mon Sep 17 00:00:00 2001 From: Rat Date: Sun, 31 Oct 2010 22:37:54 +0100 Subject: Core/ConditionMgr: use chamer/owner player for spell condition check where avaliable --HG-- branch : trunk --- src/server/game/Spells/Spell.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 7864d1b2878..6e83f43afaa 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2883,15 +2883,16 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere return; } } - if (m_caster->ToPlayer()) + if (Player* plrCaster = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself()) { //check for special spell conditions ConditionList conditions = sConditionMgr.GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id); if (!conditions.empty()) { - if (!sConditionMgr.IsPlayerMeetToConditions(m_caster->ToPlayer(), conditions)) + if (!sConditionMgr.IsPlayerMeetToConditions(plrCaster, conditions)) { - SendCastResult(SPELL_FAILED_DONT_REPORT); + //SendCastResult(SPELL_FAILED_DONT_REPORT); + SendCastResult(plrCaster, m_spellInfo, m_cast_count, SPELL_FAILED_DONT_REPORT); finish(false); return; } -- cgit v1.2.3