Skip to content

Commit e3aa419

Browse files
committed
Consider up to 2 nodes to apply climb_factor
1 parent 45b8a3b commit e3aa419

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/client/localplayer.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,15 @@ void LocalPlayer::move(f32 dtime, Environment *env,
316316
if (!(is_valid_position && is_valid_position2)) {
317317
is_climbing = false;
318318
} else {
319-
is_climbing = (nodemgr->get(node.getContent()).climbable ||
320-
nodemgr->get(node2.getContent()).climbable) && !free_move;
319+
bool climbable_upper = nodemgr->get(node.getContent()).climbable;
320+
bool climbable_lower = nodemgr->get(node2.getContent()).climbable;
321+
is_climbing = (climbable_upper || climbable_lower) && !free_move;
321322
if (is_climbing) {
322-
node_climb_factor = nodemgr->get(node.getContent()).climb_factor;
323+
if (climbable_lower) {
324+
node_climb_factor = nodemgr->get(node2.getContent()).climb_factor;
325+
} else {
326+
node_climb_factor = nodemgr->get(node.getContent()).climb_factor;
327+
}
323328
}
324329
}
325330

0 commit comments

Comments
 (0)