fix crash on balrog dead if not enabled tnt explosion

* closes https://codeberg.org/minenux/minetest-mod-mobs_balrog/issues/4
* backported upstream commit bf4b9521cd
master
mckaygerhard 2024-04-09 23:11:57 -04:00
parent e19cb34416
commit ce2add8d5b
2 changed files with 14 additions and 9 deletions

View File

@ -4,6 +4,7 @@
[subnasa-player-server] [subnasa-player-server]
enable_pvp = true enable_pvp = true
enable_tnt = true
creative_mode = false creative_mode = false
enable_damage = true enable_damage = true
default_privs = interact, shout default_privs = interact, shout

View File

@ -117,6 +117,7 @@ if (PATH_FINDER == nil) then
PATH_FINDER = 1 PATH_FINDER = 1
end end
local enable_tnt = minetest.settings:get_bool("enable_tnt")
local spawn_nodes = {"group:stone"} local spawn_nodes = {"group:stone"}
if minetest.get_modpath("nether") then if minetest.get_modpath("nether") then
@ -206,15 +207,18 @@ mobs:register_mob("mobs_jam:balrog", {
texture = "fire_basic_flame.png", texture = "fire_basic_flame.png",
collisiondetection = true, collisiondetection = true,
}) })
tnt.boom(pos, { -- Default to enabled when in singleplayer
name = "Balrog's Blast", if enable_tnt then
radius = 14, tnt.boom(pos, {
damage_radius = 50, name = "Balrog's Blast",
disable_drops = true, radius = 14,
ignore_protection = false, damage_radius = 50,
ignore_on_blast = false, disable_drops = true,
tiles = {""}, ignore_protection = false,
}) ignore_on_blast = false,
tiles = {""},
})
end
end) end)
end, end,
}) })