mirror of
https://github.com/minetest-mods/filter.git
synced 2025-03-15 04:11:26 +00:00
Fix loss of shout privilege if server shuts down during mute
This commit is contained in:
parent
dae7d9939e
commit
a240c39a64
1 changed files with 9 additions and 0 deletions
9
init.lua
9
init.lua
|
@ -77,6 +77,7 @@ function filter.mute(name, duration)
|
|||
privs.shout = nil
|
||||
minetest.set_player_privs(name, privs)
|
||||
end
|
||||
|
||||
minetest.chat_send_player(name, "Watch your language! You have been temporarily muted")
|
||||
|
||||
muted[name] = true
|
||||
|
@ -196,4 +197,12 @@ if minetest.global_exists("rules") and rules.show then
|
|||
end)
|
||||
end
|
||||
|
||||
minetest.register_on_shutdown(function()
|
||||
for name, _ in pairs(muted) do
|
||||
local privs = minetest.get_player_privs(name)
|
||||
privs.shout = true
|
||||
minetest.set_player_privs(name, privs)
|
||||
end
|
||||
end)
|
||||
|
||||
filter.init()
|
||||
|
|
Loading…
Add table
Reference in a new issue