From 586980f672b42b710df0752f169de5b9d092ba41 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Tue, 9 Apr 2024 23:09:15 -0400 Subject: [PATCH] fix crash on balrog dead if not enabled tnt explosion * closes https://codeberg.org/minenux/minetest-mod-mobs_balrog/issues/4 * backported upstream commit https://codeberg.org/minenux/minetest-mod-mobs_balrog/commit/bf4b9521cd672e689f5b417427cf37ee81e66408 --- balrog.lua | 21 ++++++++++++--------- readme.md | 6 ++++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/balrog.lua b/balrog.lua index 34d5cc2..cedecda 100644 --- a/balrog.lua +++ b/balrog.lua @@ -117,6 +117,7 @@ if (PATH_FINDER == nil) then PATH_FINDER = 1 end +local enable_tnt = minetest.settings:get_bool("enable_tnt") local spawn_nodes = {"group:stone"} if minetest.get_modpath("nether") then @@ -206,15 +207,17 @@ mobs:register_mob("mobs_jam: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, }) diff --git a/readme.md b/readme.md index d7f976d..9db4b7d 100644 --- a/readme.md +++ b/readme.md @@ -63,6 +63,12 @@ Optionally * intlib * 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: **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...*