fix(Core/Players): Removed old and invalid Player::SetInWater funct… (#9739)
* fix(Core/Players): Removed old and invalid `Player::SetInWater` function. Updates #8729 * buildfix.
This commit is contained in:
@@ -94,19 +94,6 @@ void HostileRefMgr::setOnlineOfflineState(bool isOnline)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================
|
|
||||||
// The online / offline status is calculated and set
|
|
||||||
|
|
||||||
void HostileRefMgr::updateThreatTables()
|
|
||||||
{
|
|
||||||
HostileReference* ref = getFirst();
|
|
||||||
while (ref)
|
|
||||||
{
|
|
||||||
ref->updateOnlineStatus();
|
|
||||||
ref = ref->next();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//=================================================
|
//=================================================
|
||||||
// The references are not needed anymore
|
// The references are not needed anymore
|
||||||
// tell the source to remove them from the list and free the mem
|
// tell the source to remove them from the list and free the mem
|
||||||
|
|||||||
@@ -59,8 +59,6 @@ public:
|
|||||||
|
|
||||||
HostileReference* getFirst() { return ((HostileReference*) RefMgr<Unit, ThreatMgr>::getFirst()); }
|
HostileReference* getFirst() { return ((HostileReference*) RefMgr<Unit, ThreatMgr>::getFirst()); }
|
||||||
|
|
||||||
void updateThreatTables();
|
|
||||||
|
|
||||||
void setOnlineOfflineState(bool isOnline);
|
void setOnlineOfflineState(bool isOnline);
|
||||||
|
|
||||||
// set state for one reference, defined by Unit
|
// set state for one reference, defined by Unit
|
||||||
|
|||||||
@@ -235,7 +235,6 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this)
|
|||||||
|
|
||||||
m_MirrorTimerFlags = UNDERWATER_NONE;
|
m_MirrorTimerFlags = UNDERWATER_NONE;
|
||||||
m_MirrorTimerFlagsLast = UNDERWATER_NONE;
|
m_MirrorTimerFlagsLast = UNDERWATER_NONE;
|
||||||
m_isInWater = false;
|
|
||||||
m_drunkTimer = 0;
|
m_drunkTimer = 0;
|
||||||
m_deathTimer = 0;
|
m_deathTimer = 0;
|
||||||
m_deathExpireTime = 0;
|
m_deathExpireTime = 0;
|
||||||
@@ -2091,24 +2090,6 @@ bool Player::IsFalling() const
|
|||||||
return GetPositionZ() < m_lastFallZ && !IsInFlight();
|
return GetPositionZ() < m_lastFallZ && !IsInFlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SetInWater(bool apply)
|
|
||||||
{
|
|
||||||
if (m_isInWater == apply)
|
|
||||||
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 = apply;
|
|
||||||
|
|
||||||
// remove auras that need water/land
|
|
||||||
RemoveAurasWithInterruptFlags(apply ? AURA_INTERRUPT_FLAG_NOT_ABOVEWATER : AURA_INTERRUPT_FLAG_NOT_UNDERWATER);
|
|
||||||
|
|
||||||
getHostileRefMgr().updateThreatTables();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Player::IsInAreaTriggerRadius(const AreaTrigger* trigger) const
|
bool Player::IsInAreaTriggerRadius(const AreaTrigger* trigger) const
|
||||||
{
|
{
|
||||||
static const float delta = 5.0f;
|
static const float delta = 5.0f;
|
||||||
|
|||||||
@@ -1085,9 +1085,6 @@ public:
|
|||||||
|
|
||||||
static bool BuildEnumData(PreparedQueryResult result, WorldPacket* data);
|
static bool BuildEnumData(PreparedQueryResult result, WorldPacket* data);
|
||||||
|
|
||||||
void SetInWater(bool apply);
|
|
||||||
|
|
||||||
[[nodiscard]] bool IsInWater() const override { return m_isInWater; }
|
|
||||||
[[nodiscard]] bool IsFalling() const;
|
[[nodiscard]] bool IsFalling() const;
|
||||||
bool IsInAreaTriggerRadius(const AreaTrigger* trigger) const;
|
bool IsInAreaTriggerRadius(const AreaTrigger* trigger) const;
|
||||||
|
|
||||||
@@ -2915,7 +2912,6 @@ private:
|
|||||||
int32 m_MirrorTimer[MAX_TIMERS];
|
int32 m_MirrorTimer[MAX_TIMERS];
|
||||||
uint8 m_MirrorTimerFlags;
|
uint8 m_MirrorTimerFlags;
|
||||||
uint8 m_MirrorTimerFlagsLast;
|
uint8 m_MirrorTimerFlagsLast;
|
||||||
bool m_isInWater;
|
|
||||||
|
|
||||||
// Current teleport data
|
// Current teleport data
|
||||||
WorldLocation teleportStore_dest;
|
WorldLocation teleportStore_dest;
|
||||||
|
|||||||
@@ -3790,10 +3790,13 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsInWater())
|
// In water or jumping in water
|
||||||
|
if (IsInWater() || (GetLiquidData().Status == LIQUID_MAP_ABOVE_WATER && (IsFalling() || (ToPlayer() && ToPlayer()->IsFalling()))))
|
||||||
|
{
|
||||||
return IsUnderWater() ? c->CanEnterWater() : (c->CanEnterWater() || c->CanFly());
|
return IsUnderWater() ? c->CanEnterWater() : (c->CanEnterWater() || c->CanFly());
|
||||||
else
|
}
|
||||||
return c->CanWalk() || c->CanFly() || (c->CanSwim() && IsInWater());
|
|
||||||
|
return c->CanWalk() || c->CanFly() || (c->CanSwim() && IsInWater());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::ProcessPositionDataChanged(PositionFullTerrainStatus const& data)
|
void Unit::ProcessPositionDataChanged(PositionFullTerrainStatus const& data)
|
||||||
|
|||||||
@@ -491,13 +491,6 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plrMover && ((movementInfo.flags & MOVEMENTFLAG_SWIMMING) != 0) != plrMover->IsInWater())
|
|
||||||
{
|
|
||||||
// now client not include swimming flag in case jumping under water
|
|
||||||
plrMover->SetInWater(!plrMover->IsInWater() || plrMover->GetMap()->IsUnderWater(plrMover->GetPhaseMask(), movementInfo.pos.GetPositionX(),
|
|
||||||
movementInfo.pos.GetPositionY(), movementInfo.pos.GetPositionZ(), plrMover->GetCollisionHeight()));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool jumpopcode = false;
|
bool jumpopcode = false;
|
||||||
if (opcode == MSG_MOVE_JUMP)
|
if (opcode == MSG_MOVE_JUMP)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user