mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-06 15:58:12 +01:00
Completely bind yawrate check to angle check (includes exemption).
This commit is contained in:
parent
4a26f741df
commit
66f6d2d072
@ -122,11 +122,6 @@ public class FightListener implements Listener {
|
|||||||
|
|
||||||
final boolean worldChanged = !worldName.equals(data.lastWorld);
|
final boolean worldChanged = !worldName.equals(data.lastWorld);
|
||||||
|
|
||||||
// Improbable yaw:
|
|
||||||
if (Combined.checkYawRate(player, player.getLocation().getYaw(), now, worldName, cc.yawRateCheck && !player.hasPermission(Permissions.FIGHT_ANGLE))){
|
|
||||||
cancelled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the attacked entity.
|
// Get the attacked entity.
|
||||||
final net.minecraft.server.Entity damaged = ((CraftEntity) cbEntity).getHandle();
|
final net.minecraft.server.Entity damaged = ((CraftEntity) cbEntity).getHandle();
|
||||||
|
|
||||||
@ -140,8 +135,19 @@ public class FightListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!cancelled && angle.isEnabled(player) && angle.check(player, worldChanged))
|
if (!cancelled && angle.isEnabled(player)){
|
||||||
|
// Improbable yaw.
|
||||||
|
if (Combined.checkYawRate(player, player.getLocation().getYaw(), now, worldName, cc.yawRateCheck)){
|
||||||
|
// (Check or just feed).
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
|
}
|
||||||
|
// Angle check.
|
||||||
|
if (angle.check(player, worldChanged)) cancelled = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
// Always feed yaw rate here.
|
||||||
|
Combined.feedYawRate(player, player.getLocation().getYaw(), now, worldName);
|
||||||
|
}
|
||||||
|
|
||||||
if (!cancelled && critical.isEnabled(player) && critical.check(player))
|
if (!cancelled && critical.isEnabled(player) && critical.check(player))
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user