Declare flare particle id before use, fixes #20

This commit is contained in:
stujones11 2016-09-25 17:46:30 +01:00
parent 7349be8ab5
commit 0533d52142

View file

@ -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,