Browse files

Core/Spells: send spell error messages on spell cast condition checks.

  • Loading branch information...
1 parent 1f373c0 commit b7b37dca298682a44cd1d0c635e0bf40476eefb6 @QAston QAston committed Feb 25, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/server/game/Spells/Spell.cpp
View
9 src/server/game/Spells/Spell.cpp
@@ -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;
}
}

0 comments on commit b7b37dc

Please sign in to comment.