mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-14 19:41:21 +01:00
Let target switching only count with significant yaw changes.
This commit is contained in:
parent
35a9171934
commit
70ce2086ab
@ -21,6 +21,7 @@ public class Angle extends Check {
|
||||
|
||||
public static class AttackLocation {
|
||||
public final double x, y, z;
|
||||
/** Yaw of the attacker. */
|
||||
public final float yaw;
|
||||
public long time;
|
||||
public final UUID damagedId;
|
||||
@ -104,9 +105,13 @@ public class Angle extends Check {
|
||||
continue;
|
||||
}
|
||||
deltaMove += refLoc.distSqLast;
|
||||
deltaYaw += Math.abs(refLoc.yawDiffLast);
|
||||
final double yawDiff = Math.abs(refLoc.yawDiffLast);
|
||||
deltaYaw += yawDiff;
|
||||
deltaTime += refLoc.timeDiff;
|
||||
deltaSwitchTarget += refLoc.idDiffLast ? 1 : 0;
|
||||
if (refLoc.idDiffLast && yawDiff > 30.0) {
|
||||
// TODO: Configurable sensitivity ? Scale with yawDiff?
|
||||
deltaSwitchTarget += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if there is enough data present.
|
||||
|
Loading…
Reference in New Issue
Block a user