forked from minetest/minetest_game
TNT: self-start boom removal timer.
This commit is contained in:
parent
682d79b82a
commit
7a892c70e6
|
@ -299,7 +299,6 @@ end
|
||||||
function tnt.boom(pos, def)
|
function tnt.boom(pos, def)
|
||||||
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
|
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
|
||||||
minetest.set_node(pos, {name = "tnt:boom"})
|
minetest.set_node(pos, {name = "tnt:boom"})
|
||||||
minetest.get_node_timer(pos):start(0.5)
|
|
||||||
local drops = tnt_explode(pos, def.radius, def.ignore_protection,
|
local drops = tnt_explode(pos, def.radius, def.ignore_protection,
|
||||||
def.ignore_on_blast)
|
def.ignore_on_blast)
|
||||||
entity_physics(pos, def.damage_radius)
|
entity_physics(pos, def.damage_radius)
|
||||||
|
@ -316,6 +315,9 @@ minetest.register_node("tnt:boom", {
|
||||||
walkable = false,
|
walkable = false,
|
||||||
drop = "",
|
drop = "",
|
||||||
groups = {dig_immediate = 3},
|
groups = {dig_immediate = 3},
|
||||||
|
on_construct = function(pos)
|
||||||
|
minetest.get_node_timer(pos):start(0.5)
|
||||||
|
end,
|
||||||
on_timer = function(pos, elapsed)
|
on_timer = function(pos, elapsed)
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user