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]
enable_pvp = true
enable_tnt = true
creative_mode = false
enable_damage = true
default_privs = interact, shout

View File

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