diff options
| author | Shauren <shauren.trinity@gmail.com> | 2014-09-26 22:26:51 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2014-09-26 22:26:51 +0200 |
| commit | 605d51533c73067f5395a3e522d1d02c6f7f2047 (patch) | |
| tree | 202afb6b598468ac241c6e6b232cf62249b5b263 /src | |
| parent | b620b2d27aa1a46b89689e2f24b7ff53c2a32054 (diff) | |
Core/Spells: Always add threat for spells from spell_threat table, not only if target was hit. Unsuccessful cast results in 0 threat added instead of the full amount and creating threat list entry for caster. This fixes various exploits with taunt spells bugging out scripts due to taunt immunity/passive state (creatures would immediately evade resetting script state if no entries were present on threat list - entry with no threat is not the same as no entry)
Closes #11883
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 31aecbb65a0..2289020ee38 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4559,8 +4559,9 @@ void Spell::HandleThreatSpells() for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) { + float threatToAdd = threat; if (ihit->missCondition != SPELL_MISS_NONE) - continue; + threatToAdd = 0.0f; Unit* target = ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID); if (!target) @@ -4568,14 +4569,14 @@ void Spell::HandleThreatSpells() // positive spells distribute threat among all units that are in combat with target, like healing if (m_spellInfo->_IsPositiveSpell()) - target->getHostileRefManager().threatAssist(m_caster, threat, m_spellInfo); + target->getHostileRefManager().threatAssist(m_caster, threatToAdd, m_spellInfo); // for negative spells threat gets distributed among affected targets else { if (!target->CanHaveThreatList()) continue; - target->AddThreat(m_caster, threat, m_spellInfo->GetSchoolMask(), m_spellInfo); + target->AddThreat(m_caster, threatToAdd, m_spellInfo->GetSchoolMask(), m_spellInfo); } } TC_LOG_DEBUG("spells", "Spell %u, added an additional %f threat for %s %u target(s)", m_spellInfo->Id, threat, m_spellInfo->_IsPositiveSpell() ? "assisting" : "harming", uint32(m_UniqueTargetInfo.size())); |
