assign defaults for def

This commit is contained in:
TenPlus1 2017-09-28 15:13:11 +01:00
parent a711dcfe64
commit 7caa8bdd33

View File

@ -387,6 +387,9 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast,
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")
local sound = def.sound or "tnt_explode"