Skip to content

Commit 0b9b43b

Browse files
committed
don't double-count tnt @ the center
1 parent f661e8d commit 0b9b43b

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
@@ -299,6 +299,13 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, owne
299299
c_tnt = c_tnt_burning -- tnt is not registered if disabled
300300
end
301301

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

0 commit comments

Comments
 (0)