From e5aa847e8f117c6ae88a52f94fe0b7a6bd924983 Mon Sep 17 00:00:00 2001 From: Alar of Daggerspine Date: Mon, 23 Mar 2015 17:33:50 +0100 Subject: [PATCH] Still struggling abit with reset timer Signed-off-by: Alar of Daggerspine --- GarrisonCommander-Broker/ldb.lua | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/GarrisonCommander-Broker/ldb.lua b/GarrisonCommander-Broker/ldb.lua index 2297f8e..edaac55 100644 --- a/GarrisonCommander-Broker/ldb.lua +++ b/GarrisonCommander-Broker/ldb.lua @@ -110,8 +110,15 @@ function addon:ITEM_PUSH(event,bag,icon) print(event,bag,icon) --@end-debug@ end -function addon:CalculateModifiedDate() +function addon:CheckDateReset() + local reset=GetQuestResetTime() local weekday, month, day, year = CalendarGetDate() + self:Print("Calendar",weekday,month,day,year) + if (day <1 or reset<1) then + self:ScheduleTimer("CheckDateReset",1) + return day,reset + end + today=format("%04d%02d%02d",year,month,day) if month==1 and day==1 then local m, y, numdays, firstday = CalendarGetAbsMonth( 12, year-1 ) @@ -122,10 +129,11 @@ function addon:CalculateModifiedDate() else yesterday=format("%04d%02d%02d",year,month,day-1) end - if (GetQuestResetTime()<3600*3) then + if (reset<3600*3) then today=yesterday end - return today,yesterday + if self.db.realm.lastday