diff options
author | Spp <spp@jorge.gr> | 2012-11-26 08:43:29 +0100 |
---|---|---|
committer | Spp <spp@jorge.gr> | 2012-11-26 08:43:29 +0100 |
commit | 8ae0f2332c9f3d34f602acdaeb5409d9cb56ab79 (patch) | |
tree | 5afe17de42ae9399c730cccfaa876608f84b69ba /src/server/game/Spells/Spell.cpp | |
parent | fdf0c32857c804701e7a25b27e59b11f2a306116 (diff) | |
parent | 941be9cdc473713f97ad505114bcb32f7e3350ef (diff) |
Merge branch 'master' into 4.3.4
Conflicts:
src/server/game/Battlefield/Zones/BattlefieldWG.cpp
src/server/game/Conditions/ConditionMgr.cpp
src/server/game/Entities/Unit/Unit.cpp
src/server/game/Server/WorldSession.cpp
src/server/game/Server/WorldSocket.cpp
src/server/game/Spells/SpellEffects.cpp
src/server/scripts/EasternKingdoms/stormwind_city.cpp
src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp
src/server/scripts/Kalimdor/azshara.cpp
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rwxr-xr-x | src/server/game/Spells/Spell.cpp | 15 |
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; |