Compromise: Completely bind yawrate(fight) to the angle check.

To avoid compatibility issues with exemptions the yawrate
feeding/checking is now only done if angle is enabled. As a compromise
both are still checked, even if speed has already cancelled the event,
because the "fast turning" checks both accumulate data and depend on not
missing players attempts.
This commit is contained in:
asofold 2012-11-03 10:54:00 +01:00
parent 17395cb742
commit dd1da82abd

View File

@ -116,20 +116,16 @@ public class FightListener implements Listener {
cancelled = true;
}
if (!cancelled && angle.isEnabled(player)){
// Improbable yaw.
if (Combined.checkYawRate(player, player.getLocation().getYaw(), now, worldName, cc.yawRateCheck)){
// (Check or just feed).
cancelled = true;
}
// Angle check.
if (angle.check(player, worldChanged)) cancelled = true;
}
else{
// Always feed yaw rate here.
Combined.feedYawRate(player, player.getLocation().getYaw(), now, worldName);
}
if (angle.isEnabled(player)) {
// The "fast turning" checks are checked in any case because they accumulate data.
// Improbable yaw changing.
if (Combined.checkYawRate(player, player.getLocation().getYaw(), now, worldName, cc.yawRateCheck)) {
// (Check or just feed).
cancelled = true;
}
// Angle check.
if (angle.check(player, worldChanged)) cancelled = true;
}
if (!cancelled && critical.isEnabled(player) && critical.check(player))
cancelled = true;