Add in-air VL freeze. Regain hbuf if not frozen

This commit is contained in:
asofold 2018-02-28 12:11:32 +01:00 committed by GitHub
parent b68265dd56
commit 79e3cc9046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 7 deletions

View File

@ -509,14 +509,16 @@ public class SurvivalFly extends Check {
}
else {
// Slowly reduce the level with each event, if violations have not recently happened.
if (now - data.sfVLTime > cc.survivalFlyVLFreeze) {
// TODO: Switch to move count instead of time (!).
if (now - data.sfVLTime > cc.survivalFlyVLFreeze
&& (!cc.survivalFlyVLFreezeInAir || !Magic.inAir(thisMove))) {
// Relax VL.
data.survivalFlyVL *= 0.95D;
}
// Finally check horizontal buffer regain.
if (hDistanceAboveLimit < 0.0 && result <= 0.0 && !isSamePos && data.sfHorizontalBuffer < cc.hBufMax) {
// TODO: max min other conditions ?
hBufRegain(hDistance, Math.min(0.2, Math.abs(hDistanceAboveLimit)), data, cc);
// Finally check horizontal buffer regain.
if (hDistanceAboveLimit < 0.0 && result <= 0.0 && !isSamePos && data.sfHorizontalBuffer < cc.hBufMax) {
// TODO: max min other conditions ?
hBufRegain(hDistance, Math.min(0.2, Math.abs(hDistanceAboveLimit)), data, cc);
}
}
}