fixed a bug with single word strings and multiple choice blocks side by side

This commit is contained in:
2026-05-18 23:05:19 +01:00
parent cba3ec04d7
commit 019f1088a3
10 changed files with 37 additions and 17 deletions
+6
View File
@@ -27,6 +27,12 @@ pub fn character_parse
) -> Result<usize,(String,usize)>
{
let mut sum_index: usize = index;
let characters_hashmap = characters.lock().unwrap_or_exit("Characters Mutex was poisoned",2);
if character_name.to_lowercase() != "narrator" && ! characters_hashmap.contains_key(&character_name)
{
return Err((format!("Character {character_name} does not exist"),sum_index + 1));
}
drop(characters_hashmap);
// Ensure the index is valid (the index is not beyond the vector)
let keyword = tokenise::get_keyword_token(tokens, sum_index)
.map_err(|err| (err, sum_index))?;