From e3307d647b720cfea3c6d4f6833bb2f075a07ae7 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Fri, 30 Dec 2022 14:17:24 +0000 Subject: [PATCH] Fix pathing to bell that is sat on the ground --- mods/ENTITIES/mobs_mc/villager.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index c9a8ab6021..dcc16e16f8 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -641,7 +641,7 @@ function get_activity(tod) else activity = "chill" end - mcl_log("Time is " .. tod ..". Activity is: ".. activity) + --mcl_log("Time is " .. tod ..". Activity is: ".. activity) return activity end @@ -1200,6 +1200,16 @@ local function get_ground_below_floating_object (float_pos) local node = minetest.get_node(pos) mcl_log("First non air materials: ".. tostring(node.name)) until node.name ~= "air" + + -- If pos is 1 below float_pos, then just return float_pos as there is no air below it + if pos.y == float_pos.y -1 then + --mcl_log("pos is only 1 lower than float pos so no air below") + return float_pos + else + --mcl_log("pos is more than 1 lower than float pos so air is below") + return pos + end + return pos end