mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-24 09:25:10 +00:00
Remove TNT node when it is ignited by an explosion
After 6f12adcb
TNT nodes would not be removed when ignited by
explosions, this fixes that.
This commit is contained in:
parent
af6d5cac54
commit
455f490b4e
1 changed files with 3 additions and 3 deletions
|
@ -13,8 +13,9 @@ end
|
||||||
tnt = {}
|
tnt = {}
|
||||||
tnt.ignite = function(pos)
|
tnt.ignite = function(pos)
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
spawn_tnt(pos, "mcl_tnt:tnt")
|
local e = spawn_tnt(pos, "mcl_tnt:tnt")
|
||||||
minetest.check_for_falling(pos)
|
minetest.check_for_falling(pos)
|
||||||
|
return e
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add smoke particle of entity at pos.
|
-- Add smoke particle of entity at pos.
|
||||||
|
@ -70,9 +71,8 @@ minetest.register_node("mcl_tnt:tnt", {
|
||||||
groups = { dig_immediate = 3, tnt = 1, enderman_takable=1, flammable=-1 },
|
groups = { dig_immediate = 3, tnt = 1, enderman_takable=1, flammable=-1 },
|
||||||
mesecons = tnt_mesecons,
|
mesecons = tnt_mesecons,
|
||||||
on_blast = function(pos)
|
on_blast = function(pos)
|
||||||
local e = spawn_tnt(pos, "mcl_tnt:tnt")
|
local e = tnt.ignite(pos)
|
||||||
e:get_luaentity().timer = tnt.BOOMTIMER - (0.5 + math.random())
|
e:get_luaentity().timer = tnt.BOOMTIMER - (0.5 + math.random())
|
||||||
return true
|
|
||||||
end,
|
end,
|
||||||
_on_ignite = function(player, pointed_thing)
|
_on_ignite = function(player, pointed_thing)
|
||||||
tnt.ignite(pointed_thing.under)
|
tnt.ignite(pointed_thing.under)
|
||||||
|
|
Loading…
Reference in a new issue