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