1
0

fix crash on balrog dead if not enabled tnt explosion

* closes https://codeberg.org/minenux/minetest-mod-mobs_balrog/issues/4
This commit is contained in:
mckaygerhard 2024-04-09 23:08:00 -04:00
parent a5df5c5dff
commit bf4b9521cd
2 changed files with 13 additions and 10 deletions

View File

@ -62,7 +62,7 @@ Changelog [changelog.md](changelog.md)
## Dependencies: ## Dependencies:
* tnt, default, from basic games, * tnt, default, from basic games, `enable_tnt` if set to true balrog will explode in epic way
* mobs (or so called mobs_redo) * mobs (or so called mobs_redo)
* intllib if you are using minetest 0.4 series and only optional * intllib if you are using minetest 0.4 series and only optional

View File

@ -130,6 +130,7 @@ if (PATH_FINDER == nil) then
PATH_FINDER = 1 PATH_FINDER = 1
end end
local enable_tnt = minetest.settings:get_bool("enable_tnt") or false
local spawn_nodes = {"group:stone"} local spawn_nodes = {"group:stone"}
if minetest.get_modpath("nether") then if minetest.get_modpath("nether") then
@ -219,6 +220,7 @@ mobs:register_mob("mobs_balrog: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,
@ -228,6 +230,7 @@ mobs:register_mob("mobs_balrog:balrog", {
ignore_on_blast = false, ignore_on_blast = false,
tiles = {""}, tiles = {""},
}) })
end
end) end)
end, end,
}) })