Fix loss of shout privilege if server shuts down during mute

This commit is contained in:
rubenwardy 2018-02-02 19:29:45 +00:00 committed by sofar
parent dae7d9939e
commit a240c39a64

View File

@ -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()