Add more skipping conditions to fight.critical.

* Skip if sfDirty is set (vertical velocity).
* Don't count lowjump if it's not meant to count.
This commit is contained in:
asofold 2015-01-17 03:05:49 +01:00
parent 00c028c609
commit 40d3328c87

View File

@ -11,6 +11,7 @@ import fr.neatmonster.nocheatplus.actions.ParameterName;
import fr.neatmonster.nocheatplus.checks.Check; import fr.neatmonster.nocheatplus.checks.Check;
import fr.neatmonster.nocheatplus.checks.CheckType; import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.checks.ViolationData; import fr.neatmonster.nocheatplus.checks.ViolationData;
import fr.neatmonster.nocheatplus.checks.moving.MediumLiftOff;
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig; import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
import fr.neatmonster.nocheatplus.checks.moving.MovingData; import fr.neatmonster.nocheatplus.checks.moving.MovingData;
import fr.neatmonster.nocheatplus.checks.moving.MovingUtil; import fr.neatmonster.nocheatplus.checks.moving.MovingUtil;
@ -59,7 +60,8 @@ public class Critical extends Check {
final MovingData dataM = MovingData.getData(player); final MovingData dataM = MovingData.getData(player);
// TODO: Skip near the highest jump height (needs check if head collided with something solid, which also detects low jump). // TODO: Skip near the highest jump height (needs check if head collided with something solid, which also detects low jump).
if (dataM.sfLowJump || mcFallDistance < cc.criticalFallDistance && !BlockProperties.isResetCond(player, loc, mCc.yOnGround)) { if (!dataM.sfDirty && (dataM.sfLowJump && !dataM.sfNoLowJump && dataM.mediumLiftOff == MediumLiftOff.GROUND
|| mcFallDistance < cc.criticalFallDistance && !BlockProperties.isResetCond(player, loc, mCc.yOnGround))) {
final MovingConfig ccM = MovingConfig.getConfig(player); final MovingConfig ccM = MovingConfig.getConfig(player);
if (MovingUtil.shouldCheckSurvivalFly(player, dataM, ccM)) { if (MovingUtil.shouldCheckSurvivalFly(player, dataM, ccM)) {
data.criticalVL += 1.0; data.criticalVL += 1.0;