added a modify data function for changing the data_to_send mutex

This commit is contained in:
2026-05-16 12:40:00 +01:00
parent 9d2f615e16
commit a251be7827
6 changed files with 37 additions and 28 deletions
+1 -7
View File
@@ -12,7 +12,6 @@ use crate::
info,
debug,
warn,
UnwrapOrExit,
};
mod strings;
@@ -153,12 +152,7 @@ fn choice_parse
}
debug!("{choices:?}");
// Send the choices to the Client via the API
let mut data = data_to_send.lock().unwrap_or_exit("Data to send Mutex was poisoned",2);
data.action_type = String::from("choice");
data.content = String::new();
data.character = String::new();
data.choices = choices;
drop(data);
api::modify_data(data_to_send, "choice".to_string(), String::new(), String::new(), choices);
// Return the choice indeces
Ok((sum_index + 1, choice_indeces))
}