Fix false positives when jumping down half-blocks/stairs

This commit is contained in:
Evenprime 2011-08-17 14:10:22 +02:00
parent 3d338d5a65
commit d9985e1721
2 changed files with 5 additions and 3 deletions

View File

@ -48,7 +48,7 @@ public class FlyingCheck {
// Walk or start Jump
if(fromOnGround) {
distanceAboveLimit = toY - Math.floor(fromY) - limit;
distanceAboveLimit = toY - fromY - limit;
}
// Land or Fly/Fall
else {
@ -66,7 +66,7 @@ public class FlyingCheck {
if(toOnGround)
limit += stepHeight;
distanceAboveLimit = toY - Math.floor(l.getY()) - limit;
distanceAboveLimit = toY - l.getY() - limit;
// Always give some bonus points in case of identical Y values in
// midair (hovering player)

View File

@ -88,6 +88,7 @@ public class MovingCheck extends Check {
Location newToLocation = null;
System.out.println(from.getY() + " " + to.getY() + (from.getY() > to.getY() ? " down" : "horiz/up"));
final long startTime = System.nanoTime();
/************* DECIDE WHICH CHECKS NEED TO BE RUN *************/
@ -128,9 +129,10 @@ public class MovingCheck extends Check {
data.jumpPhase++;
if(fromOnGround) {
if(fromOnGround && from.getY() >= to.getY()) {
data.setBackPoint = from;
data.jumpPhase = 0;
System.out.println("New setback point");
} else if(result <= 0 && toOnGround) {
data.jumpPhase = 0;
}