restart smoke particle effects on reload (#48)

* restart smoke particle effects on reload

* restore table in fake_fire:reload_particles

* Update fake_fire/init.lua

Co-authored-by: OgelGames <olliverdc28@gmail.com>

Co-authored-by: OgelGames <olliverdc28@gmail.com>
This commit is contained in:
superfloh247 2022-11-19 14:34:36 +01:00 committed by GitHub
parent 8893d66dc6
commit 33710f710b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,7 @@
local S = minetest.get_translator("fake_fire")
local fake_fire_reload_particles_nodes = {}
local function fire_particles_on(pos) -- 3 layers of fire
local meta = minetest.get_meta(pos)
local id1 = minetest.add_particlespawner({ -- 1 layer big particles fire
@ -253,6 +255,7 @@ local materials = {
for _, mat in ipairs(materials) do
local name, desc, tex = unpack(mat)
table.insert(fake_fire_reload_particles_nodes, "fake_fire:chimney_top_"..name)
minetest.register_node("fake_fire:chimney_top_"..name, {
description = desc,
tiles = {tex.."^chimney_top.png", tex},
@ -333,3 +336,17 @@ minetest.register_lbm({
fire_particles_on(pos)
end
})
minetest.register_lbm({
name = "fake_fire:reload_particles_chimney",
label = "restart chimney smoke on reload",
nodenames = fake_fire_reload_particles_nodes,
run_at_every_load = true,
action = function(pos, node)
if minetest.get_meta(pos):get_int("smoky") ~= 0 then
stop_smoke(pos)
start_fire_effects(pos, node, nil, 1)
end
end
})