enable smoke effects only if nodecore.smokeclear is present, to prevent bad behavior on current nodecore stable

master
capitalthree 1 year ago
parent bcf19f8096
commit cbc2d2c1a7
  1. 21
      rules.lua

@ -27,6 +27,19 @@ local solid_drawtypes = {
glasslike_framed = true,
}
local smokecontrol
if nodecore.smokeclear then
smokecontrol = function(pos, smoke)
if smoke then
nodecore.smokefx(pos, 300, 2)
else
nodecore.smokeclear(pos)
end
end
else
smokecontrol = function(pos, smoke) end
end
--[[
E: air
E_: other empty
@ -324,12 +337,12 @@ function lc_liberties.handle_placement(pos)
for x=pos.x-18, pos.x+18 do
for z=pos.z-18, pos.z+18 do
if (x ~= pos.x) or (z ~= pos.z) then
nodecore.smokeclear({x = x, y = pos.y, z = z})
smokecontrol({x = x, y = pos.y, z = z})
end
end
end
nodecore.smokefx(pos, 300, 2)
smokecontrol(pos, 1)
end
function lc_liberties.handle_territory_fill(itemstack, placer, pointed_thing)
@ -371,7 +384,7 @@ function lc_liberties.handle_dig(pos, node, digger)
local count = 0
for i, v in pairs(connected_group(pos)) do
count = count + 1
nodecore.smokeclear(v)
smokecontrol(v)
nodecore.set_loud(v, {name = "air"})
end
@ -379,7 +392,7 @@ function lc_liberties.handle_dig(pos, node, digger)
return true
else
nodecore.smokeclear(pos)
smokecontrol(pos)
return minetest.node_dig(pos, node, digger)
end
end

Loading…
Cancel
Save