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:
parent
45b8a3bf45
commit
e3aa419695
1 changed files with 8 additions and 3 deletions
|
@ -316,12 +316,17 @@ void LocalPlayer::move(f32 dtime, Environment *env,
|
||||||
if (!(is_valid_position && is_valid_position2)) {
|
if (!(is_valid_position && is_valid_position2)) {
|
||||||
is_climbing = false;
|
is_climbing = false;
|
||||||
} else {
|
} else {
|
||||||
is_climbing = (nodemgr->get(node.getContent()).climbable ||
|
bool climbable_upper = nodemgr->get(node.getContent()).climbable;
|
||||||
nodemgr->get(node2.getContent()).climbable) && !free_move;
|
bool climbable_lower = nodemgr->get(node2.getContent()).climbable;
|
||||||
|
is_climbing = (climbable_upper || climbable_lower) && !free_move;
|
||||||
if (is_climbing) {
|
if (is_climbing) {
|
||||||
|
if (climbable_lower) {
|
||||||
|
node_climb_factor = nodemgr->get(node2.getContent()).climb_factor;
|
||||||
|
} else {
|
||||||
node_climb_factor = nodemgr->get(node.getContent()).climb_factor;
|
node_climb_factor = nodemgr->get(node.getContent()).climb_factor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Player object property step height is multiplied by BS in
|
// Player object property step height is multiplied by BS in
|
||||||
// /src/script/common/c_content.cpp and /src/content_sao.cpp
|
// /src/script/common/c_content.cpp and /src/content_sao.cpp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue