Skip to content

Commit

Permalink
Allow step up.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Mar 12, 2016
1 parent c5bda06 commit 0be4373
Showing 1 changed file with 11 additions and 4 deletions.
Expand Up @@ -137,6 +137,7 @@ public Location check(final Player player, final PlayerLocation from, final Play
if (data.bunnyhopDelay <= 0 && resultH < 0.4D) {
data.bunnyhopDelay = 9;
resultH = 0D;
tags.add("bunnyhop");
}
}

Expand All @@ -163,11 +164,17 @@ public Location check(final Player player, final PlayerLocation from, final Play
limitV = Math.max(frictionDist, limitV);
}

final double resultV;
if (yDistance > limitV && data.getOrUseVerticalVelocity(yDistance) != null) {
// Determine violation amount, post-violation recovery.
double resultV = Math.max(0.0, (yDistance - limitV) * 100.0);
// Ordinary step up. TODO: sfStepHeight should be a common modeling parameter?
if (yDistance < cc.sfStepHeight
&& (lastMove.toIsValid && lastMove.yDistance < 0.0 || from.isOnGroundOrResetCond())) {
resultV = 0.0;
tags.add("step_up");
}
// Velocity.
if (resultV > 0.0 && data.getOrUseVerticalVelocity(yDistance) != null) {
resultV = 0.0;
} else {
resultV = (yDistance - limitV) * 100D;
}

if (resultV > 0.0) {
Expand Down

0 comments on commit 0be4373

Please sign in to comment.