From 1f313ed43cb93e6a1149144a61cafc7cab79adc7 Mon Sep 17 00:00:00 2001 From: Anand S <36130650+ClobberXD@users.noreply.github.com> Date: Thu, 26 Apr 2018 08:07:00 +0530 Subject: [PATCH] Priv-check before unmuting --- init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 51fe8f9..8eafdeb 100644 --- a/init.lua +++ b/init.lua @@ -83,10 +83,14 @@ function filter.mute(name, duration) muted[name] = true minetest.after(duration * 60, function() + privs = minetest.get_player_privs(name) + if privs.shout==true then + return + end + muted[name] = nil minetest.chat_send_player(name, "Chat privilege reinstated. Please do not abuse chat.") - local privs = minetest.get_player_privs(name) privs.shout = true minetest.set_player_privs(name, privs) end)