aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRat <none@none>2010-10-31 22:37:54 +0100
committerRat <none@none>2010-10-31 22:37:54 +0100
commite68c149e6909545a61f0400fbebcafa28d44069e (patch)
tree250289b2698c8e7f4c8a02e7a095898b0b50c57d /src
parent96df97c5aef86503b4ef660c9d0d5b704b8a5c21 (diff)
Core/ConditionMgr: use chamer/owner player for spell condition check where avaliable
--HG-- branch : trunk
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp7
1 files changed, 4 insertions, 3 deletions
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;
}