Minetest-WorldEditAdditions/worldeditadditions_farwand/lib/do_raycast.lua

18 lines
611 B
Lua
Raw Permalink Normal View History

local wea_c = worldeditadditions_core
2021-02-23 22:56:56 +00:00
--- worldeditadditions.raycast() wrapper
function worldeditadditions.farwand.do_raycast(player)
if player == nil then return nil end
local player_name = player:get_player_name()
if worldeditadditions.farwand.player_data[player_name] == nil then
worldeditadditions.farwand.player_data[player_name] = { maxdist = 1000, skip_liquid = true }
end
local looking_pos, node_id = wea_c.raycast(
2021-02-23 22:56:56 +00:00
player,
worldeditadditions.farwand.player_data[player_name].maxdist,
worldeditadditions.farwand.player_data[player_name].skip_liquid
)
return looking_pos, node_id
end