Added priv check before un-muting player

Unmutes player _only_ if the player is still muted
This commit is contained in:
Anand S 2018-04-19 20:45:59 +05:30
parent 685c94bd01
commit 34f0be2f9f

View file

@ -85,11 +85,12 @@ function filter.mute(name, duration)
minetest.after(duration * 60, function()
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)
if privs.shout == false then
minetest.chat_send_player(name, "Chat privilege reinstated. Please do not abuse chat.")
privs.shout = true
minetest.set_player_privs(name, privs)
end
end)
end