Skip to content

Commit

Permalink
Some tweaks to wall climb check.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Dec 18, 2023
1 parent c0d5742 commit 1047658
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/game/Anticheat/MovementAnticheat/MovementAnticheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,19 +990,23 @@ bool MovementAnticheat::CheckWallClimb(MovementInfo const& movementInfo, uint16
return false;

float const deltaZ = movementInfo.pos.z - GetLastMovementInfo().pos.z;
if (deltaZ < 0.5f)
if (deltaZ < 1.0f)
return false;

float const angleRad = atan(deltaZ / deltaXY);
//float const angleDeg = angleRad * (360 / (M_PI_F * 2));

if (angleRad > sWorld.getConfig(CONFIG_FLOAT_AC_MOVEMENT_CHEAT_WALL_CLIMB_ANGLE))
float const maxClimbAngle = sWorld.getConfig(CONFIG_FLOAT_AC_MOVEMENT_CHEAT_WALL_CLIMB_ANGLE);
if (angleRad > maxClimbAngle)
{
if (angleRad > (maxClimbAngle + 0.2f))
return true;

// check height with and without vmaps and compare
// if player is stepping over model like stairs, that can increase wall climb angle
float const height1 = me->GetMap()->GetHeight(movementInfo.pos.x, movementInfo.pos.y, movementInfo.pos.z, false);
float const height2 = me->GetMap()->GetHeight(movementInfo.pos.x, movementInfo.pos.y, movementInfo.pos.z, true);
if ((std::abs(height1 - height2) < 0.5f) || (deltaZ > 5.0f))
if (std::abs(height1 - height2) < 0.5f)
return true;
}

Expand Down

0 comments on commit 1047658

Please sign in to comment.