mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-10-03 00:47:25 +02:00
Fix an issue with the maxphase detection.
Ignore if sfDirty is set, ignore falling, ignore bunnies.
This commit is contained in:
parent
45e5ae8cf3
commit
dc1f5eced5
@ -844,7 +844,8 @@ public class MovingData extends ACheckData {
|
||||
|
||||
// Set dirty flag here.
|
||||
if (used) {
|
||||
sfDirty = true; // TODO: Only needed for vertical velocity? Get rid anyway :p.
|
||||
// TODO: Detect when actually used? More complicated, some internal adding needs setting it here.
|
||||
sfDirty = true;
|
||||
sfNoLowJump = true;
|
||||
}
|
||||
// TODO: clear accounting here ?
|
||||
|
@ -327,25 +327,14 @@ public class SurvivalFly extends Check {
|
||||
else {
|
||||
maxJumpPhase = 6;
|
||||
}
|
||||
// TODO: consider tags for jumping as well (!).
|
||||
if (data.sfJumpPhase > maxJumpPhase && data.verticalVelocityCounter <= 0) {
|
||||
// Could use dirty flag here !
|
||||
// TODO: Could move to a method.
|
||||
if (data.sfDirty || yDistance < 0 || resetFrom) {
|
||||
if (data.getSetBackY() > to.getY()) {
|
||||
if (data.sfJumpPhase > 2 * maxJumpPhase) {
|
||||
// Ignore it for falling.
|
||||
}
|
||||
else{
|
||||
vAllowedDistance -= Math.max(0, (data.sfJumpPhase - maxJumpPhase) * 0.15D);
|
||||
}
|
||||
}
|
||||
else{
|
||||
// TODO: (This allows the one tick longer jump (resetTo)).
|
||||
vAllowedDistance -= Math.max(0, (data.sfJumpPhase - maxJumpPhase) * 0.15D);
|
||||
}
|
||||
if (data.sfJumpPhase > maxJumpPhase && data.verticalVelocityCounter <= 0 && !data.sfDirty) {
|
||||
if (yDistance < 0) {
|
||||
// Ignore falling, and let accounting deal with it.
|
||||
}
|
||||
else if (!data.sfDirty) {
|
||||
else if (resetFrom) {
|
||||
// Ignore bunny etc.
|
||||
}
|
||||
else {
|
||||
// Violation (Too high jumping or step).
|
||||
tags.add("maxphase");
|
||||
vDistanceAboveLimit = Math.max(vDistanceAboveLimit, Math.max(yDistance, 0.15));
|
||||
|
Loading…
Reference in New Issue
Block a user