fixed crash by nil positions on destruction effects

This commit is contained in:
Alexsandro Percy 2023-08-24 19:26:48 -03:00
parent 8e6a39ec81
commit 758ce12162
2 changed files with 2 additions and 0 deletions

View file

@ -680,6 +680,7 @@ function airutils.pid_controller(current_value, setpoint, last_error, d_time, kp
end
function airutils.add_destruction_effects(pos, radius, w_fire)
if pos == nil then return end
w_fire = w_fire
if w_fire == nil then w_fire = true end
local node = airutils.nodeatpos(pos)

View file

@ -61,6 +61,7 @@ function airutils.get_node_pos(pos)
end
function airutils.nodeatpos(pos)
if pos == nil then return end
local node = minetest.get_node_or_nil(pos)
if node then return minetest.registered_nodes[node.name] end
end