mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-02 13:57:49 +01:00
Make penalty time more configurable for yawrate checking.
This commit is contained in:
parent
df22700a15
commit
979fd0a5e2
@ -83,7 +83,7 @@ public class Combined {
|
||||
if (total > threshold){
|
||||
// Add time
|
||||
final float amount = ((total - threshold) / threshold * 1000f);
|
||||
data.timeFreeze = Math.max(data.timeFreeze, now + (long) amount);
|
||||
data.timeFreeze = Math.max(data.timeFreeze, (long) Math.max(cc.yawRatePenaltyFactor * ((float) now + amount) , cc.yawRatePenaltyMin));
|
||||
// TODO: balance (100 ... 200 ) ?
|
||||
if (cc.yawRateImprobable && Improbable.check(player, amount / 100f, now))
|
||||
cancel = true;
|
||||
|
@ -58,8 +58,10 @@ public class CombinedConfig extends ACheckConfig {
|
||||
public final boolean invulnerableTriggerFallDistance;
|
||||
|
||||
// Last yaw tracking
|
||||
public final float yawRate;
|
||||
public final boolean yawRateImprobable;
|
||||
public final float yawRate;
|
||||
public final boolean yawRateImprobable;
|
||||
public final float yawRatePenaltyFactor;
|
||||
public final int yawRatePenaltyMin;
|
||||
|
||||
public CombinedConfig(final ConfigFile config) {
|
||||
improbableCheck = config.getBoolean(ConfPaths.COMBINED_IMPROBABLE_CHECK, false);
|
||||
@ -104,6 +106,8 @@ public class CombinedConfig extends ACheckConfig {
|
||||
invulnerableTriggerFallDistance = config.getBoolean(ConfPaths.COMBINED_INVULNERABLE_TRIGGERS_FALLDISTANCE);
|
||||
yawRate = config.getInt(ConfPaths.COMBINED_YAWRATE_RATE);
|
||||
yawRateImprobable = config.getBoolean(ConfPaths.COMBINED_YAWRATE_IMPROBABLE);
|
||||
yawRatePenaltyFactor = (float) config.getDouble(ConfPaths.COMBINED_YAWRATE_PENALTY_FACTOR);
|
||||
yawRatePenaltyMin = config.getInt(ConfPaths.COMBINED_YAWRATE_PENALTY_MIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -318,6 +318,9 @@ public abstract class ConfPaths {
|
||||
private static final String COMBINED_YAWRATE = COMBINED + "yawrate.";
|
||||
public static final String COMBINED_YAWRATE_RATE = COMBINED_YAWRATE + "rate";
|
||||
public static final String COMBINED_YAWRATE_IMPROBABLE = COMBINED_YAWRATE + "improbable";
|
||||
private static final String COMBINED_YAWRATE_PENALTY = COMBINED_YAWRATE + "penalty.";
|
||||
public static final String COMBINED_YAWRATE_PENALTY_FACTOR = COMBINED_YAWRATE_PENALTY + "factor";
|
||||
public static final String COMBINED_YAWRATE_PENALTY_MIN = COMBINED_YAWRATE_PENALTY + "minimum";
|
||||
|
||||
/*
|
||||
* 888'Y88 ,e, 888 d8
|
||||
|
@ -242,6 +242,8 @@ public class DefaultConfig extends ConfigFile {
|
||||
set(ConfPaths.COMBINED_INVULNERABLE_MODIFIERS + ".all", 0);
|
||||
|
||||
set(ConfPaths.COMBINED_YAWRATE_RATE , 380);
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_FACTOR, 1.0);
|
||||
set(ConfPaths.COMBINED_YAWRATE_PENALTY_MIN, 250);
|
||||
set(ConfPaths.COMBINED_YAWRATE_IMPROBABLE, true);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user