Attemps to fix a crash
parent
818a4b77c4
commit
028274d1d1
|
@ -60,6 +60,9 @@ function pvpplus.get_score(name)
|
|||
if not pvpplus.is_running_tournament() then
|
||||
return false, "There is no running tournament."
|
||||
end
|
||||
if not pvpplus.is_playing_tournament(name) then
|
||||
return false, "Player " .. name .. "is not currently playing a tournament."
|
||||
end
|
||||
return tournament.sent_damages[name] - tournament.received_damages[name] + tournament.kills[name] * 20
|
||||
end
|
||||
|
||||
|
|
|
@ -11,14 +11,13 @@ function pvpplus.tournament_hud_update_list()
|
|||
tournament.hud_list = {}
|
||||
|
||||
for name, _ in pairs(tournament.sent_damages) do
|
||||
if not pvpplus.get_score(name) then
|
||||
return pvpplus.get_score(name)
|
||||
if pvpplus.get_score(name) then
|
||||
table.insert(tournament.hud_list, {
|
||||
name = name,
|
||||
score = pvpplus.get_score(name),
|
||||
status = pvpplus.is_playing_tournament(name)
|
||||
})
|
||||
end
|
||||
table.insert(tournament.hud_list, {
|
||||
name = name,
|
||||
score = pvpplus.get_score(name),
|
||||
status = pvpplus.is_playing_tournament(name)
|
||||
})
|
||||
end
|
||||
|
||||
table.sort(tournament.hud_list, function(a, b) return a.score > b.score end)
|
||||
|
|
Loading…
Reference in New Issue