diff --git a/spawners_mobs/api.lua b/spawners_mobs/api.lua index 97a33d7..4cc1a72 100644 --- a/spawners_mobs/api.lua +++ b/spawners_mobs/api.lua @@ -127,13 +127,16 @@ function spawners_mobs.tick(pos) local meta = minetest.get_meta(pos) local tick_counter = meta:get_int("tick") local owner = meta:get_string("owner") - tick_counter = tick_counter + 1 - -- print("tick_counter: "..tick_counter) + local privs = minetest.get_player_privs(owner); - if owner ~= "ADMIN" then + -- not for admin + if not privs.privs then + tick_counter = tick_counter + 1 meta:set_int("tick", tick_counter) end + -- print("tick_counter: "..tick_counter) + -- rusty spawner if tick_counter >= tick_max then spawners_mobs.set_status(pos, "rusty") @@ -395,10 +398,6 @@ function spawners_mobs.set_status(pos, set_status) if set_status == "active" then -- remove particles and add them again - keeps particles after server restart -- delete particles - - -- print("id_flame: "..id_flame) - -- print("id_smoke: "..id_smoke) - if id_flame and id_smoke then minetest.delete_particlespawner(id_flame) minetest.delete_particlespawner(id_smoke) diff --git a/spawners_mobs/spawners_mobs.lua b/spawners_mobs/spawners_mobs.lua index abf5bd9..c371f29 100644 --- a/spawners_mobs/spawners_mobs.lua +++ b/spawners_mobs/spawners_mobs.lua @@ -126,7 +126,7 @@ function spawners_mobs.create(mob_table, idx) minetest.register_lbm({ name = "spawners_mobs:start_nodetimer_"..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) end, })