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.
This commit is contained in:
parent
efa74441e3
commit
840ce2d9d8
3
init.lua
3
init.lua
@ -387,6 +387,9 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, owne
|
|||||||
end
|
end
|
||||||
|
|
||||||
function tnt.boom(pos, def)
|
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 meta = minetest.get_meta(pos)
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
if not def.explode_center then
|
if not def.explode_center then
|
||||||
|
Loading…
Reference in New Issue
Block a user