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:
parent
a5df5c5dff
commit
bf4b9521cd
@ -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
|
||||
|
||||
|
3
init.lua
3
init.lua
@ -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,6 +220,7 @@ mobs:register_mob("mobs_balrog:balrog", {
|
||||
texture = "fire_basic_flame.png",
|
||||
collisiondetection = true,
|
||||
})
|
||||
if enable_tnt then
|
||||
tnt.boom(pos, {
|
||||
name = "Balrog's Blast",
|
||||
radius = 14,
|
||||
@ -228,6 +230,7 @@ mobs:register_mob("mobs_balrog:balrog", {
|
||||
ignore_on_blast = false,
|
||||
tiles = {""},
|
||||
})
|
||||
end
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user