Skip to content

Commit

Permalink
Consider up to 2 nodes to apply climb_factor
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuzzy2 committed Oct 27, 2024
1 parent 142e2b5 commit 68fdd0c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/client/localplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,15 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
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;
}
}
}

Expand Down

0 comments on commit 68fdd0c

Please sign in to comment.