mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-26 18:37:59 +01:00
Don't deal fall damage for causing passable violations moving from
ground. This hopefully prevents a range of login/teleport problems with nofall. Does not resolve those for tp/login into air.
This commit is contained in:
parent
634ca39824
commit
a493da7ff7
@ -546,9 +546,14 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
|
||||
// Check passable first to prevent set-back override.
|
||||
// TODO: Redesign to set set-backs later (queue + invalidate).
|
||||
boolean mightSkipNoFall = false; // If to skip nofall check (mainly on violation of other checks).
|
||||
if (newTo == null && cc.passableCheck && !NCPExemptionManager.isExempted(player, CheckType.MOVING_PASSABLE) && !player.hasPermission(Permissions.MOVING_PASSABLE)) {
|
||||
// Passable is checked first to get the original set-back locations from the other checks, if needed.
|
||||
newTo = passable.check(player, loc, pFrom, pTo, data, cc);
|
||||
if (newTo != null){
|
||||
// Check if to skip the nofall check.
|
||||
mightSkipNoFall = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check which fly check to check.
|
||||
@ -615,7 +620,15 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
}
|
||||
else{
|
||||
if (checkNf && cc.sfFallDamage){
|
||||
noFall.checkDamage(player, data, Math.min(Math.min(from.getY(), to.getY()), loc.getY()));
|
||||
if (mightSkipNoFall){
|
||||
// Check if to really skip.
|
||||
if (!pFrom.isOnGround() && !pFrom.isResetCond()){
|
||||
mightSkipNoFall = false;
|
||||
}
|
||||
}
|
||||
if (!mightSkipNoFall){
|
||||
noFall.checkDamage(player, data, Math.min(Math.min(from.getY(), to.getY()), loc.getY()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user