Merge branch 'playerleavebugfix' into 'master'

Closes #3

Closes #3

See merge request debiankaios/tnttag!5
This commit is contained in:
debiankaios 2022-10-06 15:52:19 +00:00
commit dbf873142d
2 changed files with 11 additions and 0 deletions

View File

@ -46,6 +46,10 @@ function tnttag.untagplayer(p_name, arena)
tnttag.remove_tnthead(p_name)
end
-- get the get tagstatus
function tnttag.gettagstatus(p_name, arena)
return arena.players[p_name].tagged
end
-- Thankyou to chmodsayshello ↓
function tnttag.get_new_tagger_count(arena, num_tagger)

View File

@ -36,6 +36,13 @@ arena_lib.on_celebration("tnttag", function(arena, winner)
end)
arena_lib.on_time_tick("tnttag", function(arena)
local taggersnum = 0
for p_name,stats in pairs(arena.players) do
if tnttag.gettagstatus(p_name, arena) then taggersnum = taggersnum + 1 end
end
if taggersnum == 0 then
arena.current_time=arena.current_time-arena.current_time%arena.wavetime
end
tnttag.update_wave_timer_hud(arena)
tnttag.update_player_count_hud(arena)
if arena.current_time%arena.wavetime == 0 then