summaryrefslogtreecommitdiff
path: root/src/modules/rkt
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-08-03 01:17:48 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-08-03 01:17:48 -0700
commit26d196b00e4e692dbd9cede9ad1826ab9f2a6271 (patch)
tree45c47be9fe678047a79996b176b2c1749f2e2876 /src/modules/rkt
parent3286edff3f1a5c4e7017b98847e961975c2fb957 (diff)
modules/rkt: use the raw module name when randomizing
The existing code assumed til_module_t.name was equivalent to the name setting's value. That's no longer a safe assumption, and if the module was made possible via something like nocheck, that needs to be preserved in the randomized setup. So this gets the name out of the setting instead, using the new raw value getter.
Diffstat (limited to 'src/modules/rkt')
-rw-r--r--src/modules/rkt/rkt_scener.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/rkt/rkt_scener.c b/src/modules/rkt/rkt_scener.c
index 2dc608a..5e90eed 100644
--- a/src/modules/rkt/rkt_scener.c
+++ b/src/modules/rkt/rkt_scener.c
@@ -554,6 +554,7 @@ static int rkt_scener_randomize_scene_settings(rkt_context_t *ctxt, unsigned sce
rkt_scene_t *scene;
til_settings_t *scenes_settings;
til_setting_t *scene_setting;
+ til_setting_t *module_name_setting;
til_settings_t *new_settings;
til_setup_t *setup;
char *label;
@@ -576,7 +577,12 @@ static int rkt_scener_randomize_scene_settings(rkt_context_t *ctxt, unsigned sce
if (r < 0)
return r;
- new_settings = til_settings_new(NULL, scenes_settings, label, module->name);
+ if (!til_settings_get_value_by_idx(scene_setting->value_as_nested_settings, 0, &module_name_setting)) {
+ free(label);
+ return -EINVAL;
+ }
+
+ new_settings = til_settings_new(NULL, scenes_settings, label, til_setting_get_raw_value(module_name_setting));
free(label);
if (!new_settings)
return -ENOMEM;
© All Rights Reserved