From e3aa419695f293d4620a3ccda5cb0eb52e7faccd Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 27 Oct 2024 12:13:18 +0100 Subject: [PATCH] Consider up to 2 nodes to apply climb_factor --- src/client/localplayer.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/client/localplayer.cpp b/src/client/localplayer.cpp index 38e3f0a8bc3bd..de28387e8eaeb 100644 --- a/src/client/localplayer.cpp +++ b/src/client/localplayer.cpp @@ -316,10 +316,15 @@ void LocalPlayer::move(f32 dtime, Environment *env, if (!(is_valid_position && is_valid_position2)) { is_climbing = false; } else { - is_climbing = (nodemgr->get(node.getContent()).climbable || - nodemgr->get(node2.getContent()).climbable) && !free_move; + bool climbable_upper = nodemgr->get(node.getContent()).climbable; + bool climbable_lower = nodemgr->get(node2.getContent()).climbable; + is_climbing = (climbable_upper || climbable_lower) && !free_move; if (is_climbing) { - node_climb_factor = nodemgr->get(node.getContent()).climb_factor; + if (climbable_lower) { + node_climb_factor = nodemgr->get(node2.getContent()).climb_factor; + } else { + node_climb_factor = nodemgr->get(node.getContent()).climb_factor; + } } }