Skip to content

Commit

Permalink
Extend either way
Browse files Browse the repository at this point in the history
  • Loading branch information
stargazing-dino committed May 17, 2024
1 parent 94d183b commit 7caa9ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/runtime/src/dialogue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,13 @@ impl Dialogue {
/// Merges the currently set [`Program`] with the given one. If there is no program set, the given one is set.
pub fn add_program(&mut self, program: Program) -> &mut Self {
if let Some(existing_program) = self.vm.program.as_mut() {
*existing_program = Program::combine(vec![existing_program.clone(), program]).unwrap();
*existing_program =
Program::combine(vec![existing_program.clone(), program.clone()]).unwrap();
} else {
self.vm.program.replace(program.clone());
self.vm.reset_state();
self.extend_variable_storage_from(&program);
}
self.extend_variable_storage_from(&program);

self
}
Expand Down

0 comments on commit 7caa9ce

Please sign in to comment.