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 Dec 23, 2024
1 parent 45b8a3b commit e3aa419
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 @@ -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;
}
}
}

Expand Down

0 comments on commit e3aa419

Please sign in to comment.