From 0533d521420ccb276a1494c5a194197074c492a0 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Sun, 25 Sep 2016 17:46:30 +0100 Subject: [PATCH] Declare flare particle id before use, fixes #20 --- flaregun.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flaregun.lua b/flaregun.lua index 6904d3e..b3e071d 100644 --- a/flaregun.lua +++ b/flaregun.lua @@ -68,8 +68,6 @@ minetest.register_entity("shooter:flare_entity", { node.name ~= "default:water_flowing" then minetest.place_node(pos, {name="shooter:flare_light"}) local meta = minetest.get_meta(pos) - meta:set_int("particle_id", id) - meta:set_int("init_time", os.time()) pos.y = pos.y - 0.1 local id = minetest.add_particlespawner( 1000, 30, pos, pos, @@ -77,6 +75,8 @@ minetest.register_entity("shooter:flare_entity", { {x=2, y=-2, z=-2}, {x=2, y=-2, z=2}, 0.1, 0.75, 1, 8, false, "shooter_flare_particle.png" ) + meta:set_int("particle_id", id) + meta:set_int("init_time", os.time()) local sound = minetest.sound_play("shooter_flare_burn", { object = self.player, loop = true,