1
0
Fork 0

Potential fix for an issue when the next vp reset time cannot be calculated.

This commit is contained in:
Andrew Tomaka 2011-10-01 17:14:44 -04:00
parent d6ba74dca0
commit 2417f3b9fe

View file

@ -316,9 +316,14 @@ function core:UpdateChores()
local _,_,_,earnedThisWeek = GetCurrencyInfo(396)
-- Store Valor Points if we were able to establish a reset time.
if vpResetTime ~= nil then
-- Try to alleviate issues with vpResetTime not getting set
-- by updating vp regardless and assuming previous time is still
-- correct.
if db.global[realm][name].valorPoints == nil then
db.global[realm][name].valorPoints = {}
db.global[realm][name].valorPoints.points = earnedThisWeek
end
db.global[realm][name].valorPoints.points = earnedThisWeek
if vpResetTime ~= nil then
db.global[realm][name].valorPoints.resetTime = vpResetTime
end
@ -413,7 +418,9 @@ function core:GetNextVPReset()
resetDate.sec = resetTime.sec
vpResetTime = time(resetDate)
print(vpResetTime)
else
print('No Time')
vpResetTime = nil
end
end