"disable_jump" if the legs are inside the node
This commit is contained in:
parent
e59ae03bf5
commit
b68b7e36cf
|
@ -258,15 +258,8 @@ minetest.register_node("mobs:cobweb", {
|
|||
drawtype = "plantlike",
|
||||
visual_scale = 1.2,
|
||||
tiles = {"mobs_cobweb.png"},
|
||||
inventory_image = "mobs_cobweb.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
liquid_viscosity = 7,
|
||||
liquidtype = "source",
|
||||
liquid_alternative_flowing = "mobs:cobweb",
|
||||
liquid_alternative_source = "mobs:cobweb",
|
||||
liquid_renewable = false,
|
||||
liquid_range = 0,
|
||||
walkable = false,
|
||||
groups = {snappy = 1, disable_jump = 1, speed = -30},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
|
|
@ -497,6 +497,12 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
|
|||
|| sneak_can_jump;
|
||||
if (itemgroup_get(f.groups, "disable_jump"))
|
||||
m_can_jump = false;
|
||||
// Determine that the legs are inside the node
|
||||
v3s16 pos = getStandingNodePos();
|
||||
const ContentFeatures &f1 = nodemgr->get(map->getNodeNoEx(
|
||||
pos + v3s16(0, 1, 0)));
|
||||
if (itemgroup_get(f1.groups, "disable_jump"))
|
||||
m_can_jump = false;
|
||||
|
||||
// Jump key pressed while jumping off from a bouncy block
|
||||
if (m_can_jump && control.jump && itemgroup_get(f.groups, "bouncy") &&
|
||||
|
|
Loading…
Reference in New Issue