Core/Spells: Fix an infinite loop caused by a mix of item 25498 and liquid damage (ported commit: 9b292f436903e436bfdfdc61d40d2efffad35bca)

This commit is contained in:
Ovahlord committed 2019-07-29 10:50:42 +02:00
1 parent 45be30625c
commit 4c06f48121
2 files changed
+8 -3

No files matched your search

+4 -1
View File
@@ -3871,7 +3871,10 @@ void Spell::finish(bool ok)
if (spellInfo && spellInfo->SpellIconID == 2056)
{
TC_LOG_DEBUG("spells", "Statue %d is unsummoned in spell %d finish", m_caster->GetGUID().GetCounter(), m_spellInfo->Id);
m_caster->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 (m_caster->getDeathState() != JUST_DIED)
m_caster->setDeathState(JUST_DIED);
return;
}
}