1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-09 13:37:02 +02:00

Added safety checks.

Added:
if play_table then
   if play_table[player.name] then t = play_table[player.name] end
end
This commit is contained in:
Gerkiz 2019-07-08 23:12:03 +02:00 committed by GitHub
parent 1f69e21f11
commit 2b76400228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,8 +87,9 @@ end
local function get_rank(player)
local play_table = play_time.get_session_table()
local t = play_table[player.name]
if play_table then
if play_table[player.name] then t = play_table[player.name] end
end
local m = (player.online_time + t) / 3600
@ -138,7 +139,9 @@ local function get_sorted_list(sort_by)
player_list[i].name = player.name
t = play_table[player.name]
if play_table then
if play_table[player.name] then t = play_table[player.name] end
end
player_list[i].total_played_time = get_formatted_playtime(t + player.online_time)
player_list[i].total_played_ticks = t + player.online_time