Simplify mcl_util.get_pointed_thing
This commit is contained in:
parent
dc05d5f4f6
commit
b7fb1743f2
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user