1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Consider up to 2 nodes to apply climb_factor

This commit is contained in:
Wuzzy 2024-10-27 12:13:18 +01:00
parent 45b8a3bf45
commit e3aa419695

View file

@ -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;
}
}
}