From 5adb1caf70047216345c463606abcb5d5b6ce902 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Tue, 3 Oct 2023 15:11:56 +0100 Subject: [PATCH] use get_properties to return collisionbox --- spider.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spider.lua b/spider.lua index d6db1a9..f0c4e85 100644 --- a/spider.lua +++ b/spider.lua @@ -171,10 +171,12 @@ mobs:register_mob("mobs_monster:spider", { -- sanity check if not yaw then return end - pos.y = pos.y + self.collisionbox[2] - 0.2 + local prop = self.object:get_properties() - local dir_x = -math.sin(yaw) * (self.collisionbox[4] + 0.5) - local dir_z = math.cos(yaw) * (self.collisionbox[4] + 0.5) + pos.y = pos.y + prop.collisionbox[2] - 0.2 + + local dir_x = -math.sin(yaw) * (prop.collisionbox[4] + 0.5) + local dir_z = math.cos(yaw) * (prop.collisionbox[4] + 0.5) local nod = minetest.get_node_or_nil({ x = pos.x + dir_x, y = pos.y + 0.5,