Fix loss of shout privilege if server shuts down during mute
This commit is contained in:
parent
dae7d9939e
commit
a240c39a64
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…
Reference in New Issue
Block a user