AnidemDex/Blockflow

'Return' behavior is wrong and takes branches into consideration

Crystalwarrior opened this issue · 0 comments

image

  • I pick a talk option (the first one), it goes to the option, then returns after the dialog is shown
  • Next, it jumps back to the choices.
  • When I press the "Back" choice, it goes to the return
  • The return goes back to the 1st index, aka something that's inside the branch, leading me to believe that it considered skipping the branches' contents a jump and added it to history as one
  • Meaning, "return" statement will jump back to the condition even if it was evaluated false, so it returns to commands it shouldn't execute

This happens because the return cares about the branch, in a situation when it shouldn't.
It also leads me to believe the way to solve this issue is to just make return command only care about the previous collection - so it returns to the goto that caused a collection change, meaning branches are similar to 'functions' in code in a sense that the return statement takes you back to the last stack.