Skip to content

Commit

Permalink
Fix crash on TNT explosions if tnt is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Apr 8, 2020
1 parent 14a385d commit c1f4172
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mods/tnt/init.lua
Expand Up @@ -292,10 +292,15 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, owne
local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm1:get_data()
local count = 0
local c_tnt = minetest.get_content_id("tnt:tnt")
local c_tnt
local c_tnt_burning = minetest.get_content_id("tnt:tnt_burning")
local c_tnt_boom = minetest.get_content_id("tnt:boom")
local c_air = minetest.get_content_id("air")
if enable_tnt then
c_tnt = minetest.get_content_id("tnt:tnt")
else
c_tnt = c_tnt_burning -- tnt is not registered if disabled
end
-- make sure we still have explosion even when centre node isnt tnt related
if explode_center then
count = 1
Expand Down

0 comments on commit c1f4172

Please sign in to comment.