Core/Movement: Don't rely on client for water state detection

Port From (https://github.com/TrinityCore/TrinityCore/commit/931a3871f88737ca13277ee88444b9808b366039)
This commit is contained in:
hondacrx
2021-03-04 21:56:26 -05:00
parent 866b81af86
commit 5fd04ced4f
3 changed files with 16 additions and 16 deletions
+6 -5
View File
@@ -1894,9 +1894,9 @@ namespace Game.Entities
{
return m_isInWater;
}
public void SetInWater(bool apply)
public override void SetInWater(bool inWater)
{
if (m_isInWater == apply)
if (m_isInWater == inWater)
return;
//define player in water by opcodes
@@ -1904,11 +1904,12 @@ namespace Game.Entities
//which can't swim and move guid back into ThreatList when
//on surface.
// @todo exist also swimming mobs, and function must be symmetric to enter/leave water
m_isInWater = apply;
m_isInWater = inWater;
// remove auras that need water/land
RemoveAurasWithInterruptFlags((apply ? SpellAuraInterruptFlags.NotAbovewater : SpellAuraInterruptFlags.NotUnderwater));
// Call base
base.SetInWater(inWater);
// Update threat tables
GetHostileRefManager().UpdateThreatTables();
}
public void ValidateMovementInfo(MovementInfo mi)