From 09619a62eeae1887c3b4b5c662598d68198ae13d Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Mon, 8 May 2023 23:34:45 +0100 Subject: [PATCH] Clean up is_as_cliff code and convert to new style vector part 2 --- mods/ENTITIES/mcl_mobs/movement.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/movement.lua b/mods/ENTITIES/mcl_mobs/movement.lua index d97584b58..469ac9e85 100644 --- a/mods/ENTITIES/mcl_mobs/movement.lua +++ b/mods/ENTITIES/mcl_mobs/movement.lua @@ -219,8 +219,9 @@ function mob_class:is_at_cliff_or_danger(can_jump_cliff) local ypos = pos.y + self.collisionbox[2] -- just above floor local free_fall, blocker = minetest.line_of_sight( - {x = pos.x + dir_x, y = ypos, z = pos.z + dir_z}, - {x = pos.x + dir_x, y = ypos - self.fear_height, z = pos.z + dir_z}) + vector.new(pos.x + dir_x, ypos, pos.z + dir_z), + vector.new(pos.x + dir_x, ypos - self.fear_height, pos.z + dir_z)) + if free_fall then return true else