diff options
author | megamage <none@none> | 2008-11-08 17:43:22 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-11-08 17:43:22 -0600 |
commit | e94ec9fa715bed1b4dba60a66a049918396d47dd (patch) | |
tree | 7fde5b84e6ae21ad90925eddca95eb583ba8bb8b /src | |
parent | bc0164355f6db1fc1b6dae997b01b19f0349f156 (diff) |
[svn] Merge from mangos:
Do not check LOS for triggered spells. Fri Nov 07 16:08:30 apoc
Fix reset combopoints on miss/parry/immune and etc. Sat Nov 08 14:53:03 DiSlord
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 37b1139077f..4570e7590cc 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2729,7 +2729,18 @@ void Spell::finish(bool ok) // Clear combo at finish state if(m_caster->GetTypeId() == TYPEID_PLAYER && NeedsComboPoints(m_spellInfo)) - ((Player*)m_caster)->ClearComboPoints(); + { + // Not drop combopoints if any miss exist + bool needDrop = true; + for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit) + if (ihit->missCondition != SPELL_MISS_NONE) + { + needDrop = false; + break; + } + if (needDrop) + ((Player*)m_caster)->ClearComboPoints(); + } // call triggered spell only at successful cast (after clear combo points -> for add some if need) if(!m_TriggerSpells.empty()) @@ -3411,7 +3422,7 @@ uint8 Spell::CanCast(bool strict) if (target->isInFlight()) return SPELL_FAILED_BAD_TARGETS; - if(VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) + if(!m_IsTriggeredSpell && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) return SPELL_FAILED_LINE_OF_SIGHT; // auto selection spell rank implemented in WorldSession::HandleCastSpellOpcode |