mirror of
https://github.com/azerothcore/mod-anticheat.git
synced 2026-01-13 00:58:35 +00:00
Update: Wall Climb Imrpovement Water Hack Reporting reduction
We exempt rotating the camera from fire off with water walking hack detection, we improve angle reporting per @sveN295 formula. we also remove falling from the angle check as falling is check before hand Co-Authored-By: Sven <36102838+sven295@users.noreply.github.com> Co-Authored-By: Jinnaix <37972361+jinnaix@users.noreply.github.com>
This commit is contained in:
@@ -63,6 +63,13 @@ void AnticheatMgr::WalkOnWaterHackDetection(Player* player, MovementInfo moveme
|
|||||||
|
|
||||||
ObjectGuid key = player->GetGUID();
|
ObjectGuid key = player->GetGUID();
|
||||||
|
|
||||||
|
uint32 distance2D = (uint32)movementInfo.pos.GetExactDist2d(&m_Players[key].GetLastMovementInfo().pos);
|
||||||
|
|
||||||
|
// We don't need to check for a water walking hack if the player hasn't moved
|
||||||
|
// This is necessary since MovementHandler fires if you rotate the camera in place
|
||||||
|
if (!distance2D)
|
||||||
|
return;
|
||||||
|
|
||||||
if (player->GetLiquidData().Status == LIQUID_MAP_WATER_WALK)
|
if (player->GetLiquidData().Status == LIQUID_MAP_WATER_WALK)
|
||||||
{
|
{
|
||||||
if (!m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !movementInfo.HasMovementFlag(MOVEMENTFLAG_WATERWALKING))
|
if (!m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_WATERWALKING) && !movementInfo.HasMovementFlag(MOVEMENTFLAG_WATERWALKING))
|
||||||
@@ -370,11 +377,11 @@ void AnticheatMgr::ClimbHackDetection(Player* player, MovementInfo movementInfo,
|
|||||||
Position playerPos = player->GetPosition();
|
Position playerPos = player->GetPosition();
|
||||||
|
|
||||||
float deltaZ = fabs(playerPos.GetPositionZ() - movementInfo.pos.GetPositionZ());
|
float deltaZ = fabs(playerPos.GetPositionZ() - movementInfo.pos.GetPositionZ());
|
||||||
float deltaXY = movementInfo.pos.GetExactDist2d(&playerPos);
|
float deltaXY = movementInfo.pos.GetExactDist2d(m_Players[key].GetLastMovementInfo().pos);
|
||||||
|
|
||||||
float angle = Position::NormalizeOrientation(tan(deltaZ / deltaXY));
|
float angle = Position::NormalizeOrientation(tan(deltaZ / deltaXY));
|
||||||
|
|
||||||
if ((angle > CLIMB_ANGLE) && !m_Players[key].GetLastMovementInfo().HasMovementFlag(MOVEMENTFLAG_FALLING))
|
if (angle > CLIMB_ANGLE)
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user