From b99536196dffcd7b05d343386370e6ede8f90ca2 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 16 Nov 2019 20:00:29 -0800 Subject: modules/rtv: fix repeat prevention This broke when snow was added. --- src/modules/rtv/rtv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c index 215f5d2..d0ec618 100644 --- a/src/modules/rtv/rtv.c +++ b/src/modules/rtv/rtv.c @@ -34,7 +34,7 @@ typedef struct rtv_context_t { size_t n_modules; time_t next_switch, next_hide_caption; - const rototiller_module_t *module; + const rototiller_module_t *module, *last_module; void *module_ctxt; txt_t *caption; @@ -76,13 +76,14 @@ static void setup_next_module(rtv_context_t *ctxt) } if (ctxt->module != ctxt->snow_module) { + ctxt->last_module = ctxt->module; ctxt->module = ctxt->snow_module; ctxt->next_switch = time(NULL) + RTV_SNOW_DURATION_SECS; } else { do { i = rand() % ctxt->n_modules; } while (ctxt->modules[i] == &rtv_module || - ctxt->modules[i] == ctxt->module || + ctxt->modules[i] == ctxt->last_module || ctxt->modules[i] == ctxt->snow_module); ctxt->module = ctxt->modules[i]; -- cgit v1.2.3