Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Core/Spells: send spell error messages on spell cast condition checks.
  • Loading branch information
QAston committed Feb 25, 2012
1 parent 1f373c0 commit b7b37dc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/server/game/Spells/Spell.cpp
Expand Up @@ -4785,11 +4785,16 @@ SpellCastResult Spell::CheckCast(bool strict)
// TODO: using WorldSession::SendNotification is not blizzlike
if (Player* playerCaster = m_caster->ToPlayer())
{
if (playerCaster->GetSession() && condInfo.mLastFailedCondition
if (playerCaster->GetSession()
&& condInfo.mLastFailedCondition->ErrorTextId)
{
playerCaster->GetSession()->SendNotification(condInfo.mLastFailedCondition->ErrorTextId);
return SPELL_FAILED_DONT_REPORT;
}
}
return SPELL_FAILED_DONT_REPORT;
if (!condInfo.mLastFailedCondition->ConditionTarget)
return SPELL_FAILED_CASTER_AURASTATE;
return SPELL_FAILED_BAD_TARGETS;
}
}

Expand Down

0 comments on commit b7b37dc

Please sign in to comment.