Fix vote related bugs

* Reset playertag on new match
* Clear votes on new match
This commit is contained in:
ClobberXD 2018-08-20 15:53:42 +05:30 committed by rubenwardy
parent c1fe05b78f
commit 72c5afab55
5 changed files with 28 additions and 7 deletions

View file

@ -146,15 +146,17 @@ minetest.register_privilege("vote_admin", {
description = "Allows a player to manage running votes."
})
function vote.clear()
vote.active = {}
vote.queue = {}
vote.update_all_hud()
end
minetest.register_chatcommand("vote_clear", {
privs = {
vote_admin = true,
},
func = function(name, params)
vote.active = {}
vote.queue = {}
vote.update_all_hud()
end
func = vote.clear
})
local hudkit = dofile(minetest.get_modpath("vote") .. "/hudkit.lua")
@ -229,7 +231,7 @@ minetest.register_privilege("vote", {
})
minetest.register_privilege("vote_starter", {
description = "Can vote on issues",
description = "Can start votes on issues",
basic_priv = true
})