Hello. Sorry I'm not a programmer, so I may use some words wrong.
So I'm trying to make a turn-based jrpg prototype based on this open project below. Basically, when I called the function _play_turn(P1), P1 node goes into this coroutine function and when you "completed" selecting action and target, P1 can act and get outside of this coroutine (pic below is just a sample, not all the codes in real script)
https://github.com/GDQuest/godot-2d-jrpg-combat

The problems are:
- In the original project, there is a queue for characters to act (e.g. if P1 is faster than P2, P1 will be ready first and have to act first)
- But in my prototype, player can change characters to act if they're ready (like FF7, you can toggle between characters that have full ATB), also player can change the character to act
- The problem happens when I select P1 > select punch action > browse over targets, but not select one yet > ESC back to select action > ESC back to select character > select P2 > select punch action > select target > the result is P1 and P2 both do punch action to the target (confirmed by debug.log)
- So I'm guessing that P1 was still in _play_turn() corountine and then finished it the same as P2 completed selecting target
Is there a way to make P1 get out of _play_turn() corountine after I select another character to act?