From b7fb1743f27990ff4975f1cdbe10e6f9e62d3661 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 30 Jul 2023 03:42:31 +0200 Subject: [PATCH] Simplify mcl_util.get_pointed_thing --- mods/CORE/mcl_util/init.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 79130b0ac..3766f74b6 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -633,12 +633,7 @@ function mcl_util.get_pointed_thing(player, liquid) local look_dir = vector.multiply(player:get_look_dir(), 5) local pos2 = vector.add(pos, look_dir) local ray = minetest.raycast(pos, pos2, false, liquid) - - if ray then - for pointed_thing in ray do - return pointed_thing - end - end + return ray:next() end -- This following part is 2 wrapper functions + helpers for