Clear kill list on new match

This commit is contained in:
ClobberXD 2018-12-31 04:38:05 +05:30 committed by rubenwardy
parent 7acf79df24
commit f2c864ac04
2 changed files with 2 additions and 3 deletions

View file

@ -1,3 +1,4 @@
ctf ctf
ctf_match
hudkit hudkit
irc? irc?

View file

@ -146,14 +146,12 @@ function ctf_events.update(player)
end end
function ctf_events.update_all() function ctf_events.update_all()
print("Updating ctf_event logs for all players")
for _, player in pairs(minetest.get_connected_players()) do for _, player in pairs(minetest.get_connected_players()) do
ctf_events.update(player) ctf_events.update(player)
end end
end end
ctf.register_on_killedplayer(function(victim, killer, type) ctf.register_on_killedplayer(function(victim, killer, type)
print("Player killed, posting ctf_event")
ctf_events.post("kill_" .. type, killer, victim) ctf_events.post("kill_" .. type, killer, victim)
ctf_events.update_all() ctf_events.update_all()
end) end)
@ -162,7 +160,7 @@ minetest.register_on_joinplayer(function(player)
ctf_events.update(player) ctf_events.update(player)
end) end)
ctf.register_on_new_game(function() ctf_match.register_on_new_match(function()
ctf_events.events = {} ctf_events.events = {}
ctf_events.update_all() ctf_events.update_all()
end) end)