1
0
mirror of https://codeberg.org/tenplus1/mobs_monster.git synced 2024-12-23 01:10:26 +01:00

use get_properties to return collisionbox

This commit is contained in:
tenplus1 2023-10-03 15:11:56 +01:00
parent 2661e900e7
commit 5adb1caf70

View File

@ -171,10 +171,12 @@ mobs:register_mob("mobs_monster:spider", {
-- sanity check -- sanity check
if not yaw then return end 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) pos.y = pos.y + prop.collisionbox[2] - 0.2
local dir_z = math.cos(yaw) * (self.collisionbox[4] + 0.5)
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({ local nod = minetest.get_node_or_nil({
x = pos.x + dir_x, x = pos.x + dir_x,
y = pos.y + 0.5, y = pos.y + 0.5,