diff options
author | megamage <none@none> | 2009-01-23 14:23:25 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-23 14:23:25 -0600 |
commit | f0ebb960642ad0fa43fa49fd3cc76f6516de6cd3 (patch) | |
tree | a6fa76445cfa07bf060a473ad1910c724fa679a4 /src/game/Spell.cpp | |
parent | b28b8b5ced6f0e0a7b52403010a7b465b5a765ae (diff) | |
parent | c3ce24c30fc824d73f719780d7791a0095c14d61 (diff) |
*Update to HG 957.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r-- | src/game/Spell.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index f17cfa0c83a..6869485266a 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2058,7 +2058,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura) } } -void Spell::cancel() +void Spell::cancel(bool report) { if(m_spellState == SPELL_STATE_FINISHED) return; @@ -2088,7 +2088,7 @@ void Spell::cancel() m_caster->RemoveAurasDueToCasterSpell(m_spellInfo->Id, m_caster->GetGUID()); SendChannelUpdate(0); SendInterrupted(0); - SendCastResult(SPELL_FAILED_INTERRUPTED); + SendCastResult(report ? SPELL_FAILED_INTERRUPTED : SPELL_FAILED_DONT_REPORT); } break; default: @@ -3687,7 +3687,8 @@ uint8 Spell::CanCast(bool strict) // check correctness positive/negative cast target (pet cast real check and cheating check) if(IsPositiveSpell(m_spellInfo->Id)) { - if(m_caster->IsHostileTo(target)) + //dispel positivity is dependant on target, don't check it + if(m_caster->IsHostileTo(target) && !IsDispel(m_spellInfo)) return SPELL_FAILED_BAD_TARGETS; } else @@ -3932,6 +3933,12 @@ uint8 Spell::CanCast(bool strict) if(m_targets.getUnitTarget() && !m_caster->IsFriendlyTo(m_targets.getUnitTarget()) && !m_caster->HasInArc( M_PI, target )) return SPELL_FAILED_UNIT_NOT_INFRONT; } + else if (m_spellInfo->Id == 19938) // Awaken Peon + { + Unit *unit = m_targets.getUnitTarget(); + if(!unit || !unit->HasAura(17743, 0)) + return SPELL_FAILED_BAD_TARGETS; + } break; } case SPELL_EFFECT_SCHOOL_DAMAGE: |