From 2417f3b9fec61193aa96ed34416cb6df58be7f77 Mon Sep 17 00:00:00 2001 From: atomaka Date: Sat, 1 Oct 2011 17:14:44 -0400 Subject: [PATCH] Potential fix for an issue when the next vp reset time cannot be calculated. --- ChoreTracker.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ChoreTracker.lua b/ChoreTracker.lua index 120e150..db22f24 100644 --- a/ChoreTracker.lua +++ b/ChoreTracker.lua @@ -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