Reset jumpphase and setback for moving in/onto laddrs/vines in any case.

This commit is contained in:
asofold 2012-09-21 15:07:59 +02:00
parent 2aea67b463
commit 2cf9f5f9f8

View File

@ -250,19 +250,25 @@ public class SurvivalFly extends Check {
data.setBack = to.getLocation(); data.setBack = to.getLocation();
data.setBack.setY(Math.ceil(data.setBack.getY())); data.setBack.setY(Math.ceil(data.setBack.getY()));
data.survivalFlyJumpPhase = 0; data.survivalFlyJumpPhase = 0;
} else if ((to.isInWeb() || to.isOnLadder() || toOnGround) } else if (to.isOnLadder()
&& (from.getY() >= to.getY() || data.setBack.getY() <= Math.floor(to.getY()))) { || (to.isInWeb() || 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 // Set set back and jump phase, if:
// least at the same height, or if the player is in web or on a ladder. // 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.setBack = to.getLocation();
data.survivalFlyJumpPhase = 0; data.survivalFlyJumpPhase = 0;
} else { } else {
if (from.isInLiquid() || fromOnGround || from.isInWeb() || from.isOnLadder()) if (from.isInLiquid() || fromOnGround || from.isInWeb() || from.isOnLadder()){
data.setBack = from.getLocation(); data.setBack = from.getLocation();
if (from.isInLiquid() || to.isInLiquid() || from.isInWeb() || to.isInWeb() || fromOnGround if ( to.isInLiquid() || to.isInWeb() || toOnGround || to.isOnLadder()){
|| toOnGround || from.isOnLadder() || to.isOnLadder()) // The player at least touched the ground somehow.
// The player at least touched the ground somehow. data.survivalFlyJumpPhase = 0;
data.survivalFlyJumpPhase = 0; }
}
} }
return null; return null;