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

Add disable_jump check for the player's feet

This commit is contained in:
MoNTE48 2019-12-11 20:03:12 +01:00 committed by sfan5
parent 65a6a316d0
commit 34862a6442
3 changed files with 13 additions and 3 deletions

View file

@ -436,9 +436,11 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
Check properties of the node on which the player is standing
*/
const ContentFeatures &f = nodemgr->get(map->getNode(m_standing_node));
const ContentFeatures &f1 = nodemgr->get(map->getNode(m_standing_node + v3s16(0, 1, 0)));
// Determine if jumping is possible
m_disable_jump = itemgroup_get(f.groups, "disable_jump");
m_disable_jump = itemgroup_get(f.groups, "disable_jump") ||
itemgroup_get(f1.groups, "disable_jump");
m_can_jump = ((touching_ground && !is_climbing) || sneak_can_jump) && !m_disable_jump;
// Jump key pressed while jumping off from a bouncy block