mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/ConditionMgr: use chamer/owner player for spell condition check where avaliable
--HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user