Simplify mcl_util.get_pointed_thing

This commit is contained in:
cora 2023-07-30 03:42:31 +02:00 committed by ryvnf
parent dc05d5f4f6
commit b7fb1743f2

View File

@ -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