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 -2
View File
@@ -3308,14 +3308,16 @@ void Unit::ProcessTerrainStatusUpdate(ZLiquidStatus status, Optional<LiquidData>
if (_lastLiquid && _lastLiquid->SpellId)
RemoveAurasDueToSpell(_lastLiquid->SpellId);
Player* player = GetCharmerOrOwnerPlayerOrPlayerItself();
// Set _lastLiquid before casting liquid spell to avoid infinite loops
_lastLiquid = curLiquid;
if (curLiquid && curLiquid->SpellId && (!player || !player->IsGameMaster()))
CastSpell(this, curLiquid->SpellId, true);
// Update mount capabilities when changing liquidstatus (enabling / disabling flight auras for example)
if (player)
player->UpdateMountCapabilities();
_lastLiquid = curLiquid;
}
}
void Unit::DeMorph()