Skip to content

Commit fa4c77f

Browse files
authoredJul 29, 2017
TNT: Only burn visually connected powder (#1857)
1 parent c81165b commit fa4c77f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

Diff for: ‎mods/tnt/init.lua

+8-8
Original file line numberDiff line numberDiff line change
@@ -513,17 +513,17 @@ minetest.register_node("tnt:gunpowder_burning", {
513513
on_timer = function(pos, elapsed)
514514
for dx = -1, 1 do
515515
for dz = -1, 1 do
516-
for dy = -1, 1 do
517-
if not (dx == 0 and dz == 0) then
518-
tnt.burn({
519-
x = pos.x + dx,
520-
y = pos.y + dy,
521-
z = pos.z + dz,
522-
})
516+
if math.abs(dx) + math.abs(dz) == 1 then
517+
for dy = -1, 1 do
518+
tnt.burn({
519+
x = pos.x + dx,
520+
y = pos.y + dy,
521+
z = pos.z + dz,
522+
})
523+
end
523524
end
524525
end
525526
end
526-
end
527527
minetest.remove_node(pos)
528528
end,
529529
-- unaffected by explosions

0 commit comments

Comments
 (0)
Please sign in to comment.