Only store Valor Points if the reset time can be retrieved.
This commit is contained in:
parent
30ba107491
commit
b37b1baac0
1 changed files with 8 additions and 4 deletions
|
@ -158,9 +158,11 @@ function core:UpdateChores()
|
||||||
local vpReset = core:GetNextVPReset()
|
local vpReset = core:GetNextVPReset()
|
||||||
|
|
||||||
--store Valor Points
|
--store Valor Points
|
||||||
self.db.global.valorPoints[name] = {}
|
if vpReset ~= nil then
|
||||||
self.db.global.valorPoints[name].points = earnedThisWeek
|
self.db.global.valorPoints[name] = {}
|
||||||
self.db.global.valorPoints[name].resetTime = vpReset
|
self.db.global.valorPoints[name].points = earnedThisWeek
|
||||||
|
self.db.global.valorPoints[name].resetTime = vpReset
|
||||||
|
end
|
||||||
|
|
||||||
--store Saved Instances
|
--store Saved Instances
|
||||||
local savedInstances = GetNumSavedInstances()
|
local savedInstances = GetNumSavedInstances()
|
||||||
|
@ -228,7 +230,7 @@ function core:GetNextVPReset()
|
||||||
|
|
||||||
local title,hour,minute = CalendarGetDayEvent(monthOffset, day, i)
|
local title,hour,minute = CalendarGetDayEvent(monthOffset, day, i)
|
||||||
|
|
||||||
if(title == 'Baradin Hold') then
|
if title == 'Baradin Hold' then
|
||||||
resetDate = { year = year, month = month + monthOffset, day = day }
|
resetDate = { year = year, month = month + monthOffset, day = day }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -251,5 +253,7 @@ function core:GetNextVPReset()
|
||||||
resetDate.sec = resetTime.sec
|
resetDate.sec = resetTime.sec
|
||||||
|
|
||||||
return time(resetDate)
|
return time(resetDate)
|
||||||
|
else
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue