From acd7b53ca813d372d4b6953a402d10efaf92a0d8 Mon Sep 17 00:00:00 2001 From: asofold Date: Sun, 12 Aug 2012 05:51:12 +0200 Subject: [PATCH] Attmept 3 to fix vehicles. --- .../nocheatplus/checks/moving/MovingListener.java | 2 +- .../neatmonster/nocheatplus/checks/moving/NoFall.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java b/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java index 9c53e3ce..f81d46ff 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java @@ -488,7 +488,7 @@ public class MovingListener implements Listener { Location newTo = null; - // Emergency fix: + // Emergency fix attempt: final MovingData data = MovingData.getData(player); data.clearFlyData(); player.setFallDistance(0.0f); diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java b/src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java index 6df9ff6d..a58ec344 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/NoFall.java @@ -48,13 +48,19 @@ public class NoFall extends Check { public void check(final Player player, final PlayerLocation from, final PlayerLocation to) { final MovingConfig cc = MovingConfig.getConfig(player); final MovingData data = MovingData.getData(player); - + + if (player.isInsideVehicle()){ + // Emergency fix attempt: + data.noFallFallDistance = 0; // Hope the vehicle move does the rest. + return; + } + // If the player has just started falling, is falling into a liquid, in web or is on a ladder. if (to.isInLiquid() || to.isInWeb() || to.isOnLadder()) // Reset his fall distance. data.noFallFallDistance = 0D; - data.noFallFallDistance = data.noFallFallDistance; + data.noFallFallDistance = data.noFallFallDistance; // TODO: ?? // If the player just touched the ground for the server, but no for the client. if (!data.noFallWasOnGroundServer && data.noFallOnGroundServer