From a893cba9d3d24e450d27a5c547c49ca73d5ca86a Mon Sep 17 00:00:00 2001 From: blinry Date: Mon, 9 Nov 2020 19:37:26 +0100 Subject: [PATCH] When yielding after an async command, call the rest deferred This might help fix the crash bug? --- levels/time-machine/sequence | 2 +- scenes/terminal.gd | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/levels/time-machine/sequence b/levels/time-machine/sequence index d961cab..4c5c31f 100644 --- a/levels/time-machine/sequence +++ b/levels/time-machine/sequence @@ -1,9 +1,9 @@ +conflict init checkout-commit branching merge branches -conflict pull-push rebase reorder diff --git a/scenes/terminal.gd b/scenes/terminal.gd index 9fb6bbc..6671aec 100644 --- a/scenes/terminal.gd +++ b/scenes/terminal.gd @@ -78,7 +78,9 @@ func send_command(command): var cmd = repository.shell.run_async(command, false) yield(cmd, "done") - + call_deferred("command_done", cmd) + +func command_done(cmd): if cmd.exit_code == 0: $OkSound.pitch_scale = rand_range(0.8, 1.2) $OkSound.play() @@ -89,7 +91,7 @@ func send_command(command): input.editable = true if cmd.output.length() <= 1000: - output.text = output.text + "$ " + command + "\n" + cmd.output + output.text = output.text + "$ " + cmd.command + "\n" + cmd.output else: $Pager/Text.text = cmd.output $Pager.popup()