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,15 +220,17 @@ mobs:register_mob("mobs_balrog: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,
}) })