Core/Spells: Fix infinite loop

Port From (https://github.com/TrinityCore/TrinityCore/commit/e6e73b7b13ddc48f98f46d1af13a95b9cf67cccd)
This commit is contained in:
hondacrx
2022-01-01 17:55:01 -05:00
parent f564667466
commit 86f7a08870
2 changed files with 9 additions and 2 deletions
+4 -1
View File
@@ -3174,7 +3174,10 @@ namespace Game.Spells
if (spellInfo != null && spellInfo.IconFileDataId == 134230)
{
Log.outDebug(LogFilter.Spells, "Statue {0} is unsummoned in spell {1} finish", unitCaster.GetGUID().ToString(), m_spellInfo.Id);
unitCaster.SetDeathState(DeathState.JustDied);
// 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() != DeathState.JustDied)
unitCaster.SetDeathState(DeathState.JustDied);
return;
}
}