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:
UltraNix
2021-12-28 13:34:45 +01:00
committed by GitHub
parent f88203a73a
commit a54c84f349
6 changed files with 6 additions and 48 deletions

View File

@@ -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
// tell the source to remove them from the list and free the mem

View File

@@ -59,8 +59,6 @@ public:
HostileReference* getFirst() { return ((HostileReference*) RefMgr<Unit, ThreatMgr>::getFirst()); }
void updateThreatTables();
void setOnlineOfflineState(bool isOnline);
// set state for one reference, defined by Unit

View File

@@ -235,7 +235,6 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this)
m_MirrorTimerFlags = UNDERWATER_NONE;
m_MirrorTimerFlagsLast = UNDERWATER_NONE;
m_isInWater = false;
m_drunkTimer = 0;
m_deathTimer = 0;
m_deathExpireTime = 0;
@@ -2091,24 +2090,6 @@ bool Player::IsFalling() const
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
{
static const float delta = 5.0f;

View File

@@ -1085,9 +1085,6 @@ public:
static bool BuildEnumData(PreparedQueryResult result, WorldPacket* data);
void SetInWater(bool apply);
[[nodiscard]] bool IsInWater() const override { return m_isInWater; }
[[nodiscard]] bool IsFalling() const;
bool IsInAreaTriggerRadius(const AreaTrigger* trigger) const;
@@ -2915,7 +2912,6 @@ private:
int32 m_MirrorTimer[MAX_TIMERS];
uint8 m_MirrorTimerFlags;
uint8 m_MirrorTimerFlagsLast;
bool m_isInWater;
// Current teleport data
WorldLocation teleportStore_dest;

View File

@@ -3790,10 +3790,13 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const
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());
else
return c->CanWalk() || c->CanFly() || (c->CanSwim() && IsInWater());
}
return c->CanWalk() || c->CanFly() || (c->CanSwim() && IsInWater());
}
void Unit::ProcessPositionDataChanged(PositionFullTerrainStatus const& data)

View File

@@ -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;
if (opcode == MSG_MOVE_JUMP)
{