Fix an issue with the maxphase detection.

Ignore if sfDirty is set, ignore falling, ignore bunnies.
This commit is contained in:
asofold 2015-03-26 22:10:41 +01:00
parent 45e5ae8cf3
commit dc1f5eced5
2 changed files with 9 additions and 19 deletions

View File

@ -844,7 +844,8 @@ public class MovingData extends ACheckData {
// Set dirty flag here.
if (used) {
sfDirty = true; // TODO: Only needed for vertical velocity? Get rid anyway :p.
// TODO: Detect when actually used? More complicated, some internal adding needs setting it here.
sfDirty = true;
sfNoLowJump = true;
}
// TODO: clear accounting here ?

View File

@ -327,25 +327,14 @@ public class SurvivalFly extends Check {
else {
maxJumpPhase = 6;
}
// TODO: consider tags for jumping as well (!).
if (data.sfJumpPhase > maxJumpPhase && data.verticalVelocityCounter <= 0) {
// Could use dirty flag here !
// TODO: Could move to a method.
if (data.sfDirty || yDistance < 0 || resetFrom) {
if (data.getSetBackY() > to.getY()) {
if (data.sfJumpPhase > 2 * maxJumpPhase) {
// Ignore it for falling.
}
else{
vAllowedDistance -= Math.max(0, (data.sfJumpPhase - maxJumpPhase) * 0.15D);
}
}
else{
// TODO: (This allows the one tick longer jump (resetTo)).
vAllowedDistance -= Math.max(0, (data.sfJumpPhase - maxJumpPhase) * 0.15D);
}
if (data.sfJumpPhase > maxJumpPhase && data.verticalVelocityCounter <= 0 && !data.sfDirty) {
if (yDistance < 0) {
// Ignore falling, and let accounting deal with it.
}
else if (!data.sfDirty) {
else if (resetFrom) {
// Ignore bunny etc.
}
else {
// Violation (Too high jumping or step).
tags.add("maxphase");
vDistanceAboveLimit = Math.max(vDistanceAboveLimit, Math.max(yDistance, 0.15));