1
0
Fork 0

fix crash on balrog dead if not enabled tnt explosion

* closes https://codeberg.org/minenux/minetest-mod-mobs_balrog/issues/4
master
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:
* 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)
* 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
end
local enable_tnt = minetest.settings:get_bool("enable_tnt") or false
local spawn_nodes = {"group:stone"}
if minetest.get_modpath("nether") then
@ -219,15 +220,17 @@ mobs:register_mob("mobs_balrog: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 = {""},
})
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,
})