small code tweaks
This commit is contained in:
parent
87b6d7a37e
commit
6b777ed9d6
@ -127,13 +127,16 @@ function spawners_mobs.tick(pos)
|
|||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local tick_counter = meta:get_int("tick")
|
local tick_counter = meta:get_int("tick")
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
tick_counter = tick_counter + 1
|
local privs = minetest.get_player_privs(owner);
|
||||||
-- print("tick_counter: "..tick_counter)
|
|
||||||
|
|
||||||
if owner ~= "ADMIN" then
|
-- not for admin
|
||||||
|
if not privs.privs then
|
||||||
|
tick_counter = tick_counter + 1
|
||||||
meta:set_int("tick", tick_counter)
|
meta:set_int("tick", tick_counter)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- print("tick_counter: "..tick_counter)
|
||||||
|
|
||||||
-- rusty spawner
|
-- rusty spawner
|
||||||
if tick_counter >= tick_max then
|
if tick_counter >= tick_max then
|
||||||
spawners_mobs.set_status(pos, "rusty")
|
spawners_mobs.set_status(pos, "rusty")
|
||||||
@ -395,10 +398,6 @@ function spawners_mobs.set_status(pos, set_status)
|
|||||||
if set_status == "active" then
|
if set_status == "active" then
|
||||||
-- remove particles and add them again - keeps particles after server restart
|
-- remove particles and add them again - keeps particles after server restart
|
||||||
-- delete particles
|
-- delete particles
|
||||||
|
|
||||||
-- print("id_flame: "..id_flame)
|
|
||||||
-- print("id_smoke: "..id_smoke)
|
|
||||||
|
|
||||||
if id_flame and id_smoke then
|
if id_flame and id_smoke then
|
||||||
minetest.delete_particlespawner(id_flame)
|
minetest.delete_particlespawner(id_flame)
|
||||||
minetest.delete_particlespawner(id_smoke)
|
minetest.delete_particlespawner(id_smoke)
|
||||||
|
@ -126,7 +126,7 @@ function spawners_mobs.create(mob_table, idx)
|
|||||||
minetest.register_lbm({
|
minetest.register_lbm({
|
||||||
name = "spawners_mobs:start_nodetimer_"..mod_prefix.."_"..mob_name.."_spawner",
|
name = "spawners_mobs:start_nodetimer_"..mod_prefix.."_"..mob_name.."_spawner",
|
||||||
nodenames = "spawners_mobs:"..mod_prefix.."_"..mob_name.."_spawner",
|
nodenames = "spawners_mobs:"..mod_prefix.."_"..mob_name.."_spawner",
|
||||||
action = function(pos, node)
|
action = function(pos)
|
||||||
spawners_mobs.tick_short(pos)
|
spawners_mobs.tick_short(pos)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user