Skip to content

Commit 8743c60

Browse files
committed
fix(climb): only engage slide when backward direction is downhill
The slide gate previously used |forwardAlongStrand.y|, so it ignored the sign of the slide direction. On shallow ropes (chord <30 deg from horizontal) where computeForwardIsLast picks forward from player look, forward can resolve to downhill. Holding S + sprint then activated the slide and sent the player rapidly uphill, which contradicts the gravity-assisted intent of the mechanic. Add forwardAlongStrand.y > 0 to the slide gate so the slide only engages when "backward" along the chord actually points down. Vertical and steeply-angled ropes are unaffected because computeForwardIsLast already forces forward = uphill above the VERTICAL_BIAS threshold. Holding S without sprint still works on forward-is-downhill ropes; only the sprint turbo is suppressed. Closes #96
1 parent da8bd2c commit 8743c60

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main/java/dev/matejhozlar/climbableropes/ClimbController.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,13 @@ private static void tickClimb(Minecraft mc, LocalPlayer player) {
381381
double slideDecel = ClimbableRopesConfig.SLIDE_DECELERATION.get();
382382

383383
double verticalComponent = Math.abs(forwardAlongStrand.y);
384+
// The slide is gravity-assisted descent; only engage when "backward" along the chord
385+
// actually points downhill (i.e. forward points uphill). On shallow ropes where
386+
// forwardAlongStrand was chosen from player look, forward can be downhill and
387+
// sliding would otherwise rocket the player uphill.
384388
boolean slideEffective = climbDown && sprint && !descentBlocked
385-
&& slideSpeed * verticalComponent > descendSpeed;
389+
&& slideSpeed * verticalComponent > descendSpeed
390+
&& forwardAlongStrand.y > 0;
386391
if (climbUp || descentBlocked) {
387392
slideVelocity = 0.0;
388393
} else if (slideEffective) {

0 commit comments

Comments
 (0)