From 3cfa6cfb06fa76ab232307a0a6ebef23d704bfbd Mon Sep 17 00:00:00 2001 From: asofold Date: Wed, 16 Dec 2015 18:39:36 +0100 Subject: [PATCH] Invalidate currently processed move, if a teleport happened. Should only be possible to happen, if an actions entry doesn't use 'ncp delay ...' for teleporting, or if a hook teleports the player (both discouraged). --- .../nocheatplus/checks/moving/MovingListener.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java index 6f783e28..6377b455 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java @@ -750,7 +750,14 @@ public class MovingListener extends CheckListener implements TickListener, IRemo processBounce(player, pFrom.getY(), pTo.getY(), data, cc); } // Finished move processing. - data.finishThisMove(); + if (processingEvents.containsKey(playerName)) { + // Normal processing. + // TODO: More simple: UUID keys or a data flag instead? + data.finishThisMove(); + } else { + // Teleport during violation processing, just invalidate thisMove. + data.thisMove.invalidate(); + } return false; } else {