Use the correct comparison operator.
This commit is contained in:
parent
c7dbcfac41
commit
2dbe9e00df
1 changed files with 9 additions and 2 deletions
|
@ -37,6 +37,7 @@ function core:ViewChores()
|
||||||
end
|
end
|
||||||
|
|
||||||
function core:UpdateChores()
|
function core:UpdateChores()
|
||||||
|
print('Updating Chores.')
|
||||||
local level = UnitLevel('player')
|
local level = UnitLevel('player')
|
||||||
|
|
||||||
if(level == 85) then
|
if(level == 85) then
|
||||||
|
@ -46,26 +47,32 @@ function core:UpdateChores()
|
||||||
--reset data if necessary
|
--reset data if necessary
|
||||||
for k,v in pairs(self.db.profile.lockouts) do
|
for k,v in pairs(self.db.profile.lockouts) do
|
||||||
for x,y in pairs(self.db.profile.lockouts[k]) do
|
for x,y in pairs(self.db.profile.lockouts[k]) do
|
||||||
if y.resetTime > time() then
|
print('Comparing',x,'for',name,':',y.resetTime,'<',time())
|
||||||
self.db.profile.lockouts[k][x] = nil
|
if y.resetTime < time() then
|
||||||
|
print('Passed resetTime for',k,x)
|
||||||
|
--self.db.profile.lockouts[k][x] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--store Valor Points
|
--store Valor Points
|
||||||
|
print('Storing',earnedThisWeek,'Valor points for',name)
|
||||||
self.db.profile.valorPoints[name] = earnedThisWeek
|
self.db.profile.valorPoints[name] = earnedThisWeek
|
||||||
|
|
||||||
--store Saved Instances
|
--store Saved Instances
|
||||||
|
print('Storing instances for',name)
|
||||||
local savedInstances = GetNumSavedInstances()
|
local savedInstances = GetNumSavedInstances()
|
||||||
for i = 1, savedInstances do
|
for i = 1, savedInstances do
|
||||||
local instanceName,_,instanceReset,_,_,_,_,_,_,_,_,defeatedBosses = GetSavedInstanceInfo(i)
|
local instanceName,_,instanceReset,_,_,_,_,_,_,_,_,defeatedBosses = GetSavedInstanceInfo(i)
|
||||||
|
|
||||||
if trackedInstances[instanceName] == true then
|
if trackedInstances[instanceName] == true then
|
||||||
if instanceReset > 0 then
|
if instanceReset > 0 then
|
||||||
|
print('Saving',instanceName,'with',defeatedBosses,'defeated bosses for',name)
|
||||||
self.db.profile.lockouts[name][instanceName] = {}
|
self.db.profile.lockouts[name][instanceName] = {}
|
||||||
self.db.profile.lockouts[name][instanceName].defeatedBosses = defeatedBosses
|
self.db.profile.lockouts[name][instanceName].defeatedBosses = defeatedBosses
|
||||||
self.db.profile.lockouts[name][instanceName].resetTime = time() + instanceReset
|
self.db.profile.lockouts[name][instanceName].resetTime = time() + instanceReset
|
||||||
else
|
else
|
||||||
|
print('Resetting',instanceName,'for',name)
|
||||||
self.db.profile.lockouts[name][instanceName] = nil
|
self.db.profile.lockouts[name][instanceName] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue