From 6c6c4dd3978911269d7ce124c70faff281d91211 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 27 Aug 2019 16:35:26 +0200 Subject: [PATCH] Fix loop condition when > 1h --- hugvey/story.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hugvey/story.py b/hugvey/story.py index aee72be..e84d50e 100644 --- a/hugvey/story.py +++ b/hugvey/story.py @@ -403,7 +403,7 @@ class Condition(object): if not story.lastMsgFinishTime: return False - loopTime = story.hugvey.command.timer.getElapsed() + loopTime = story.hugvey.command.timer.getElapsed() % 3600 givenTime = int(self.vars['time']) 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_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: return