summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2019-11-16 20:00:29 -0800
committerVito Caputo <vcaputo@pengaru.com>2019-11-16 20:06:48 -0800
commitb99536196dffcd7b05d343386370e6ede8f90ca2 (patch)
tree38b3de5b00cd5cf8e7b9bd40dcf1ff41869d7950 /src
parent79fd2e75eb449b2cbd1950e4863075b78608a247 (diff)
modules/rtv: fix repeat prevention
This broke when snow was added.
Diffstat (limited to 'src')
-rw-r--r--src/modules/rtv/rtv.c5
1 files changed, 3 insertions, 2 deletions
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];
© All Rights Reserved