Let target switching only count with significant yaw changes.

This commit is contained in:
asofold 2015-05-31 20:33:13 +02:00
parent 35a9171934
commit 70ce2086ab
2 changed files with 9 additions and 4 deletions

View File

@ -21,6 +21,7 @@ public class Angle extends Check {
public static class AttackLocation {
public final double x, y, z;
/** Yaw of the attacker. */
public final float yaw;
public long time;
public final UUID damagedId;
@ -104,9 +105,13 @@ public class Angle extends Check {
continue;
}
deltaMove += refLoc.distSqLast;
deltaYaw += Math.abs(refLoc.yawDiffLast);
final double yawDiff = Math.abs(refLoc.yawDiffLast);
deltaYaw += yawDiff;
deltaTime += refLoc.timeDiff;
deltaSwitchTarget += refLoc.idDiffLast ? 1 : 0;
if (refLoc.idDiffLast && yawDiff > 30.0) {
// TODO: Configurable sensitivity ? Scale with yawDiff?
deltaSwitchTarget += 1;
}
}
// Check if there is enough data present.