From 9048ac043a02c5414708a3a720b913e7a0f163a1 Mon Sep 17 00:00:00 2001 From: Hizuro Date: Fri, 2 Jun 2023 01:41:37 +0200 Subject: [PATCH] Fix nil error on countryLocalizedNames. Reported on github ticket #1 --- LibTime-1.0.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LibTime-1.0.lua b/LibTime-1.0.lua index 6650660..02b1fdd 100644 --- a/LibTime-1.0.lua +++ b/LibTime-1.0.lua @@ -89,16 +89,16 @@ local function realmTimeSyncTickerFunc() end function events.VARIABLES_LOADED() + UIParent:RegisterEvent("TIME_PLAYED_MSG"); +end + +function events.PLAYER_LOGIN() for index,data in ipairs(countries) do local name,shift,dst = strsplit(";",data); countries[index] = {name=lib.countryLocalizedNames[name] or name,timeshift=tonumber(shift),dst=dst==1}; countryNames[index] = lib.countryLocalizedNames[name] or name; end - lib.countryLocalizedNames = nil; -- one table with names is enough ;) - UIParent:RegisterEvent("TIME_PLAYED_MSG"); -end -function events.PLAYER_LOGIN() local hours, minutes, seconds = GetGameTime(); playedSession = time(); if tonumber(seconds) then