diff options
author | jackpoz <giacomopoz@gmail.com> | 2019-07-28 17:13:48 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-17 21:44:04 +0100 |
commit | e6e73b7b13ddc48f98f46d1af13a95b9cf67cccd (patch) | |
tree | 322f7b37aa45b1049a4140a774db04241aaf4348 /src/server/game/Spells/Spell.cpp | |
parent | b4000b3375dc9dec20ccc3643b89024c387f0d93 (diff) |
Core/Spells: Fix infinite loop
Fix an infinite loop caused by a mix of item 25498 and liquid damage
(cherry picked from commit 9b292f436903e436bfdfdc61d40d2efffad35bca)
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 4e70226bca0..a13a22044c9 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3953,7 +3953,10 @@ void Spell::finish(bool ok) if (spellInfo && spellInfo->IconFileDataId == 134230) { TC_LOG_DEBUG("spells", "Statue %s is unsummoned in spell %d finish", unitCaster->GetGUID().ToString().c_str(), m_spellInfo->Id); - unitCaster->setDeathState(JUST_DIED); + // Avoid infinite loops with setDeathState(JUST_DIED) being called over and over + // It might make sense to do this check in Unit::setDeathState() and all overloaded functions + if (unitCaster->getDeathState() != JUST_DIED) + unitCaster->setDeathState(JUST_DIED); return; } } |