Core/Objects: cache current liquid status of objects when updating position data and use it to replace unnecessary vmap lookups
Port From (https://github.com/TrinityCore/TrinityCore/commit/d18d2b84f2c3e6e1005316625da80c99dd414bcc)
This commit is contained in:
@@ -1914,30 +1914,6 @@ namespace Game.Entities
|
||||
return startLevel;
|
||||
}
|
||||
|
||||
public override bool IsUnderWater()
|
||||
{
|
||||
return IsInWater() &&
|
||||
GetPositionZ() < (GetMap().GetWaterLevel(GetPhaseShift(), GetPositionX(), GetPositionY()) - 2);
|
||||
}
|
||||
public override bool IsInWater()
|
||||
{
|
||||
return m_isInWater;
|
||||
}
|
||||
public override void SetInWater(bool inWater)
|
||||
{
|
||||
if (m_isInWater == inWater)
|
||||
return;
|
||||
|
||||
//define player in water by opcodes
|
||||
//move player's guid into HateOfflineList of those mobs
|
||||
//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 = inWater;
|
||||
|
||||
// Call base
|
||||
base.SetInWater(inWater);
|
||||
}
|
||||
public void ValidateMovementInfo(MovementInfo mi)
|
||||
{
|
||||
var RemoveViolatingFlags = new Action<bool, MovementFlag>((check, maskToRemove) =>
|
||||
|
||||
Reference in New Issue
Block a user