mirror of
https://github.com/APercy/airutils.git
synced 2025-03-23 03:12:20 +00:00
fixed crash by nil positions on destruction effects
This commit is contained in:
parent
8e6a39ec81
commit
758ce12162
2 changed files with 2 additions and 0 deletions
|
@ -680,6 +680,7 @@ function airutils.pid_controller(current_value, setpoint, last_error, d_time, kp
|
||||||
end
|
end
|
||||||
|
|
||||||
function airutils.add_destruction_effects(pos, radius, w_fire)
|
function airutils.add_destruction_effects(pos, radius, w_fire)
|
||||||
|
if pos == nil then return end
|
||||||
w_fire = w_fire
|
w_fire = w_fire
|
||||||
if w_fire == nil then w_fire = true end
|
if w_fire == nil then w_fire = true end
|
||||||
local node = airutils.nodeatpos(pos)
|
local node = airutils.nodeatpos(pos)
|
||||||
|
|
|
@ -61,6 +61,7 @@ function airutils.get_node_pos(pos)
|
||||||
end
|
end
|
||||||
|
|
||||||
function airutils.nodeatpos(pos)
|
function airutils.nodeatpos(pos)
|
||||||
|
if pos == nil then return end
|
||||||
local node = minetest.get_node_or_nil(pos)
|
local node = minetest.get_node_or_nil(pos)
|
||||||
if node then return minetest.registered_nodes[node.name] end
|
if node then return minetest.registered_nodes[node.name] end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue