cleanup duplicated check

This commit is contained in:
whosit 2021-05-31 09:33:58 +03:00
parent 393ef6a80b
commit ee04e06144

View File

@ -301,9 +301,7 @@ local function compass_use_callback(itemstack, user, pointed_thing)
end
if user:get_player_control()["sneak"] then
if pointed_thing.type == "nothing" then
if user and user:is_player() then
pointed_thing = waypoint_lib.raycast_crosshair(user, COMPASS_RANGE, POINT_TO_OBJECTS, POINT_TO_LIQUIDS)
end
pointed_thing = waypoint_lib.raycast_crosshair(user, COMPASS_RANGE, POINT_TO_OBJECTS, POINT_TO_LIQUIDS)
end
set_waypoint_at_pointed_place(itemstack, pointed_thing)
update_hud_waypoint(user, itemstack)