diff --git a/szutil_nowonline/init.lua b/szutil_nowonline/init.lua index cfa2128..c3ffe07 100644 --- a/szutil_nowonline/init.lua +++ b/szutil_nowonline/init.lua @@ -11,13 +11,16 @@ local timedelay = tonumber(minetest.settings:get(modname .. "_time")) or 300 local linedelay = tonumber(minetest.settings:get(modname .. "_lines")) or 25 local maxnames = tonumber(minetest.settings:get(modname .. "_names")) or 50 +local stpriv = minetest.settings:get(modname .. "_hide") or "stealth" +local function isstealth(p) return minetest.check_player_privs(p, stpriv) end + local lines = 0 local exp = 0 local function announce() local names = {} for _, player in pairs(minetest.get_connected_players()) do - if not minetest.check_player_privs(player, "stealth") then + if not isstealth(player) then names[#names + 1] = player:get_player_name() end end