aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2019-07-28 17:13:48 +0200
committerjackpoz <giacomopoz@gmail.com>2019-07-28 17:13:48 +0200
commit9b292f436903e436bfdfdc61d40d2efffad35bca (patch)
treeec5dfd6a65dc332dd30eeadf16399a27e466fb7e /src/server/game/Spells
parentf7eeb4525f30eb06c68462232920f53e87007a54 (diff)
Core/Spells: Fix infinite loop
Fix an infinite loop caused by a mix of item 25498 and liquid damage
Diffstat (limited to 'src/server/game/Spells')
-rw-r--r--src/server/game/Spells/Spell.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 5bd1505565c..073a15a047d 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3816,7 +3816,10 @@ void Spell::finish(bool ok)
if (spellInfo && spellInfo->SpellIconID == 2056)
{
TC_LOG_DEBUG("spells", "Statue %d is unsummoned in spell %d finish", unitCaster->GetGUID().GetCounter(), 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;
}
}