Skip to content

Commit 4cd18a9

Browse files
committed
don't double-count tnt @ the center
1 parent 20793b8 commit 4cd18a9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mods/tnt/init.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,13 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, owne
300300
c_tnt = c_tnt_burning -- tnt is not registered if disabled
301301
end
302302

303+
-- don't double-count tnt @ the center
304+
local v = a:index(pos.x, pos.y, pos.z)
305+
local c = data[v]
306+
if (c == c_tnt or c == c_tnt_boom or c == c_tnt_burning) then
307+
data[v] = c_air
308+
end
309+
303310
for z = pos.z - 2, pos.z + 2 do
304311
for y = pos.y - 2, pos.y + 2 do
305312
local vi = a:index(pos.x - 2, y, z)

0 commit comments

Comments
 (0)