From 2cf9f5f9f8a16c96ff9f216f0dbbd215bfc3d19b Mon Sep 17 00:00:00 2001 From: asofold Date: Fri, 21 Sep 2012 15:07:59 +0200 Subject: [PATCH] Reset jumpphase and setback for moving in/onto laddrs/vines in any case. --- .../checks/moving/SurvivalFly.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java b/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java index 8a78fe23..8dc9971f 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java @@ -250,19 +250,25 @@ public class SurvivalFly extends Check { data.setBack = to.getLocation(); data.setBack.setY(Math.ceil(data.setBack.getY())); data.survivalFlyJumpPhase = 0; - } else if ((to.isInWeb() || to.isOnLadder() || toOnGround) - && (from.getY() >= to.getY() || data.setBack.getY() <= Math.floor(to.getY()))) { - // If the player moved down "onto" the ground and the new setback point is higher up than the old or at - // least at the same height, or if the player is in web or on a ladder. + } else if (to.isOnLadder() + || (to.isInWeb() || toOnGround) && (from.getY() >= to.getY() || data.setBack.getY() <= Math.floor(to.getY()))) { + // Set set back and jump phase, if: + // 1. Moving onto ladder/vine. + /* + * 2. If the player moved down "onto" the ground or in web and ... + * the new setback point is higher up than the old or at + * least at the same height. + */ data.setBack = to.getLocation(); data.survivalFlyJumpPhase = 0; } else { - if (from.isInLiquid() || fromOnGround || from.isInWeb() || from.isOnLadder()) - data.setBack = from.getLocation(); - if (from.isInLiquid() || to.isInLiquid() || from.isInWeb() || to.isInWeb() || fromOnGround - || toOnGround || from.isOnLadder() || to.isOnLadder()) - // The player at least touched the ground somehow. - data.survivalFlyJumpPhase = 0; + if (from.isInLiquid() || fromOnGround || from.isInWeb() || from.isOnLadder()){ + data.setBack = from.getLocation(); + if ( to.isInLiquid() || to.isInWeb() || toOnGround || to.isOnLadder()){ + // The player at least touched the ground somehow. + data.survivalFlyJumpPhase = 0; + } + } } return null;