mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-14 19:41:21 +01:00
Fix issue with hover check on players joining.
Re-check if survivalfly is checked at all for the player in case of exceeding hover-ticks.
This commit is contained in:
parent
e342b07654
commit
eb28f4775c
@ -1098,6 +1098,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
// Reset hover ticks until a better method is used.
|
// Reset hover ticks until a better method is used.
|
||||||
if (cc.sfHoverCheck){
|
if (cc.sfHoverCheck){
|
||||||
// Start as if hovering already.
|
// Start as if hovering already.
|
||||||
|
// Could check shouldCheckSurvivalFly(player, data, cc), but this should be more sharp (gets checked on violation).
|
||||||
data.sfHoverTicks = 0;
|
data.sfHoverTicks = 0;
|
||||||
hoverTicks.add(player.getName());
|
hoverTicks.add(player.getName());
|
||||||
}
|
}
|
||||||
@ -1233,11 +1234,19 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (data.sfHoverTicks > cc.sfHoverTicks){
|
if (data.sfHoverTicks > cc.sfHoverTicks){
|
||||||
|
// Re-Check if survivalfly can apply at all.
|
||||||
|
if (shouldCheckSurvivalFly(player, data, cc)){
|
||||||
handleHoverViolation(player, loc, cc, data);
|
handleHoverViolation(player, loc, cc, data);
|
||||||
// Assume the player might still be hovering.
|
// Assume the player might still be hovering.
|
||||||
res = false;
|
res = false;
|
||||||
data.sfHoverTicks = 0;
|
data.sfHoverTicks = 0;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
// Reset hover ticks and check next period.
|
||||||
|
res = false;
|
||||||
|
data.sfHoverTicks = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
else res = false;
|
else res = false;
|
||||||
}
|
}
|
||||||
info.cleanup();
|
info.cleanup();
|
||||||
|
Loading…
Reference in New Issue
Block a user