Skip to content

Commit c1f4172

Browse files
committedApr 8, 2020
Fix crash on TNT explosions if tnt is disabled
1 parent 14a385d commit c1f4172

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

Diff for: ‎mods/tnt/init.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,15 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, owne
292292
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
293293
local data = vm1:get_data()
294294
local count = 0
295-
local c_tnt = minetest.get_content_id("tnt:tnt")
295+
local c_tnt
296296
local c_tnt_burning = minetest.get_content_id("tnt:tnt_burning")
297297
local c_tnt_boom = minetest.get_content_id("tnt:boom")
298298
local c_air = minetest.get_content_id("air")
299+
if enable_tnt then
300+
c_tnt = minetest.get_content_id("tnt:tnt")
301+
else
302+
c_tnt = c_tnt_burning -- tnt is not registered if disabled
303+
end
299304
-- make sure we still have explosion even when centre node isnt tnt related
300305
if explode_center then
301306
count = 1

0 commit comments

Comments
 (0)
Please sign in to comment.