1
0

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
This commit is contained in:
mckaygerhard 2024-04-09 23:09:15 -04:00
parent 4fb57dd20a
commit 586980f672
2 changed files with 18 additions and 9 deletions

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,6 +207,7 @@ mobs:register_mob("mobs_jam:balrog", {
texture = "fire_basic_flame.png", texture = "fire_basic_flame.png",
collisiondetection = true, collisiondetection = true,
}) })
if enable_tnt then
tnt.boom(pos, { tnt.boom(pos, {
name = "Balrog's Blast", name = "Balrog's Blast",
radius = 14, radius = 14,
@ -215,6 +217,7 @@ mobs:register_mob("mobs_jam:balrog", {
ignore_on_blast = false, ignore_on_blast = false,
tiles = {""}, tiles = {""},
}) })
end
end) end)
end, end,
}) })

View File

@ -63,6 +63,12 @@ Optionally
* intlib * intlib
* lucky_blocks * lucky_blocks
### Configurations
animals has a bunch of options
balrog needs `enable_tnt` to set to true if you want to explote on dead!
## Animals: ## Animals:
**Note**: *After breeding, animals need to rest for 4 minutes and baby animals take 4 minutes to grow up, also feeding them helps them grow quicker...* **Note**: *After breeding, animals need to rest for 4 minutes and baby animals take 4 minutes to grow up, also feeding them helps them grow quicker...*