Fix loop condition when > 1h

This commit is contained in:
Ruben van de Ven 2019-08-27 16:35:26 +02:00
parent db16887c91
commit 6c6c4dd397

View file

@ -403,7 +403,7 @@ class Condition(object):
if not story.lastMsgFinishTime: if not story.lastMsgFinishTime:
return False return False
loopTime = story.hugvey.command.timer.getElapsed() loopTime = story.hugvey.command.timer.getElapsed() % 3600
givenTime = int(self.vars['time']) givenTime = int(self.vars['time'])
if 'inverseMatch' in self.vars and self.vars['inverseMatch']: if 'inverseMatch' in self.vars and self.vars['inverseMatch']:
@ -950,7 +950,8 @@ class Diversion(object):
window_open_second = float(self.params['start_second']) window_open_second = float(self.params['start_second'])
window_close_second = window_open_second + float(self.params['window']) window_close_second = window_open_second + float(self.params['window'])
now = story.hugvey.command.timer.getElapsed() # Only keep a 1h loop
now = story.hugvey.command.timer.getElapsed() % 3600
if now < window_open_second or now > window_close_second: if now < window_open_second or now > window_close_second:
return return