mirror of
https://github.com/minetest-mods/filter.git
synced 2025-04-30 05:41:45 -04:00
Added priv check before un-muting player
Unmutes player _only_ if the player is still muted
This commit is contained in:
parent
685c94bd01
commit
34f0be2f9f
1 changed files with 5 additions and 4 deletions
9
init.lua
9
init.lua
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue