From 840ce2d9d8b918712050981fc985bd141fcf5d9f Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Thu, 28 Sep 2017 15:18:52 +0100 Subject: [PATCH] TNT: Add tnt.boom defaults This adds def, def.radius and def.damage_radius defaults to the tnt.boom() function if they aren't specified on call. --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index f3e22fd..133431c 100644 --- a/init.lua +++ b/init.lua @@ -387,6 +387,9 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, owne end function tnt.boom(pos, def) + def = def or {} + def.radius = def.radius or 1 + def.damage_radius = def.damage_radius or def.radius * 2 local meta = minetest.get_meta(pos) local owner = meta:get_string("owner") if not def.explode_center then