Add fence gate as overhigh in mob task templates

This commit is contained in:
Wuzzy 2024-06-03 15:33:51 +02:00
parent eb68eae2c9
commit b99d6a5e17

View File

@ -361,7 +361,8 @@ rp_mobs.microtasks.follow_path = function(path, walk_speed, jump_strength, set_y
-- due to the overhigh collisionbox -- due to the overhigh collisionbox
local next_pos_below = vector.offset(next_pos, 0, -1, 0) local next_pos_below = vector.offset(next_pos, 0, -1, 0)
local next_node_below = minetest.get_node(next_pos_below) local next_node_below = minetest.get_node(next_pos_below)
if minetest.get_item_group(next_node_below.name, "fence") == 1 then if minetest.get_item_group(next_node_below.name, "fence") == 1 or
minetest.get_item_group(next_node_below.name, "fence_gate") ~= 0 then
next_pos.y = next_pos.y + 0.5 next_pos.y = next_pos.y + 0.5
end end
end end
@ -588,9 +589,12 @@ local can_clear_jump = function(mob, jump_clear_height)
end end
-- Add 0.5 to height if top node is a fence due to the overhigh collisionbox -- Add 0.5 to height if top node is a fence due to the overhigh collisionbox
if node_top_walkable and minetest.get_item_group(node_top_walkable.name, "fence") ~= 0 then if node_top_walkable then
if minetest.get_item_group(node_top_walkable.name, "fence") ~= 0 or
minetest.get_item_group(node_top_walkable.name, "fence_gate") ~= 0 then
h = h + 0.5 h = h + 0.5
end end
end
if h <= jump_clear_height then if h <= jump_clear_height then
return true return true