From 458f6558ded9e4a7941f903957046a7ca7e63160 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sat, 29 Jul 2017 18:09:15 +0200 Subject: [PATCH] TNT: Only burn visually connected powder (#1857) --- init.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 5500d64..606ab6a 100644 --- a/init.lua +++ b/init.lua @@ -513,17 +513,17 @@ minetest.register_node("tnt:gunpowder_burning", { on_timer = function(pos, elapsed) for dx = -1, 1 do for dz = -1, 1 do - for dy = -1, 1 do - if not (dx == 0 and dz == 0) then - tnt.burn({ - x = pos.x + dx, - y = pos.y + dy, - z = pos.z + dz, - }) + if math.abs(dx) + math.abs(dz) == 1 then + for dy = -1, 1 do + tnt.burn({ + x = pos.x + dx, + y = pos.y + dy, + z = pos.z + dz, + }) + end end end end - end minetest.remove_node(pos) end, -- unaffected by explosions