Improve lightning fire creation

This commit is contained in:
IamPyu 2024-12-16 15:21:27 -06:00
parent 6f7a75ab23
commit 8184d5803c

View File

@ -45,7 +45,9 @@ PyuTest.lightning_strike = function(pos, radius, size)
if y_pos then
local npos = vector.new(pos.x + x, y_pos, pos.z +z)
if math.random(1, 6) == 1 then
local b = core.get_node(npos).name == "air"
local b2 = core.get_node(npos - vector.new(0, 1, 0)).name ~= "air"
if math.random(1, 6) == 1 and b and b2 then
core.set_node(npos, {name = "pyutest_blocks:fire"})
end
end