added timer to tnt:tnt_burning for explosions
authortenplus1 <tenplus1@users.noreply.github.com>
Tue, 9 Feb 2016 21:34:03 +0000 (21:34 +0000)
committerparamat <mat.gregory@virginmedia.com>
Thu, 18 Feb 2016 13:56:57 +0000 (13:56 +0000)
By adding the timer to the tnt:tnt_burning node it will help mods add the block and cause an explosion after 4 seconds instead of doing nothing like in it's current state.

mods/tnt/init.lua

index 4e033c61aaeb7278f13fac99da83335fa3658ed5..981cc9ee7be6dcdd009f9d64d52b571d0e733e18 100644 (file)
@@ -234,7 +234,6 @@ minetest.register_node("tnt:tnt", {
                if puncher:get_wielded_item():get_name() == "default:torch" then
                        minetest.sound_play("tnt_ignite", {pos=pos})
                        minetest.set_node(pos, {name="tnt:tnt_burning"})
-                       minetest.get_node_timer(pos):start(4)
                end
        end,
        on_blast = function(pos, intensity)
@@ -258,6 +257,9 @@ minetest.register_node("tnt:tnt_burning", {
        light_source = 5,
        drop = "",
        sounds = default.node_sound_wood_defaults(),
+       on_construct = function(pos)
+               minetest.get_node_timer(pos):start(4)
+       end,
        on_timer = boom,
        -- unaffected by explosions
        on_blast = function() end,