fix pointing to objects

This commit is contained in:
whosit 2025-04-01 12:00:23 +03:00
parent a493a51f7c
commit c4023d454c

View File

@ -35,7 +35,8 @@ end
local function raycast_crosshair_to_object(player, range)
local p_eye_pos = player_get_eye_pos(player)
local to = vector.add(p_eye_pos, vector.multiply(player:get_look_dir(), range))
local ray = core.raycast(p_eye_pos, to, point_to_objects, point_to_liquids)
-- point_to_objects = true, point_to_liquids = false
local ray = core.raycast(p_eye_pos, to, true, false)
local pointed_thing = ray:next()
while pointed_thing do
if pointed_thing.type == "object" then