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:
asofold 2013-02-27 21:39:22 +01:00
parent e342b07654
commit eb28f4775c

View File

@ -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();