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
+5 -1
View File
@@ -847,10 +847,14 @@ namespace Game.Entities
{
if (_lastLiquid != null && _lastLiquid.SpellID != 0)
RemoveAurasDueToSpell(_lastLiquid.SpellID);
Player player = GetCharmerOrOwnerPlayerOrPlayerItself();
// Set _lastLiquid before casting liquid spell to avoid infinite loops
_lastLiquid = curLiquid;
if (curLiquid != null && curLiquid.SpellID != 0 && (!player || !player.IsGameMaster()))
CastSpell(this, curLiquid.SpellID, true);
_lastLiquid = curLiquid;
// mount capability depends on liquid state change
UpdateMountCapability();