Skip to content

Commit

Permalink
Fix nil error on countryLocalizedNames. Reported on github ticket #1
Browse files Browse the repository at this point in the history
  • Loading branch information
hizuro committed Jun 1, 2023
1 parent 91453fe commit 9048ac0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions LibTime-1.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9048ac0

Please sign in to comment.