From 31e6e3801336bd4a6a6855db1ed543e353f27221 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Mon, 8 May 2023 23:33:58 +0100 Subject: [PATCH] Clean up is_as_cliff code and convert to new style vector --- 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 9dedd7e2c..d97584b58 100644 --- a/mods/ENTITIES/mcl_mobs/movement.lua +++ b/mods/ENTITIES/mcl_mobs/movement.lua @@ -262,8 +262,9 @@ function mob_class:is_at_water_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 - 3, z = pos.z + dir_z}) + vector.new(pos.x + dir_x, ypos, pos.z + dir_z), + vector.new(pos.x + dir_x, ypos - 3, pos.z + dir_z)) + if free_fall then return true else