aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 4c22328cd26..b38d5f085b6 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4884,17 +4884,12 @@ SpellCastResult Spell::CheckCast(bool strict)
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id);
if (!conditions.empty() && !sConditionMgr->IsObjectMeetToConditions(condInfo, conditions))
{
- // send error msg to player if condition failed and text message available
- // TODO: using WorldSession::SendNotification is not blizzlike
- if (Player* playerCaster = m_caster->ToPlayer())
+ // mLastFailedCondition can be NULL if there was an error processing the condition in Condition::Meets (i.e. wrong data for ConditionTarget or others)
+ if (condInfo.mLastFailedCondition && condInfo.mLastFailedCondition->ErrorType)
{
- // mLastFailedCondition can be NULL if there was an error processing the condition in Condition::Meets (i.e. wrong data for ConditionTarget or others)
- if (playerCaster->GetSession() && condInfo.mLastFailedCondition
- && condInfo.mLastFailedCondition->ErrorTextId)
- {
- playerCaster->GetSession()->SendNotification(condInfo.mLastFailedCondition->ErrorTextId);
- return SPELL_FAILED_DONT_REPORT;
- }
+ if (condInfo.mLastFailedCondition->ErrorType == SPELL_FAILED_CUSTOM_ERROR)
+ m_customError = SpellCustomErrors(condInfo.mLastFailedCondition->ErrorTextId);
+ return SpellCastResult(condInfo.mLastFailedCondition->ErrorType);
}
if (!condInfo.mLastFailedCondition || !condInfo.mLastFailedCondition->ConditionTarget)
return SPELL_FAILED_CASTER_AURASTATE;