diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-08-19 18:00:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-19 18:00:20 +0200 |
commit | ce85179e5df30f2670f9a7f2089d13e1676ebdd1 (patch) | |
tree | 95828a1960a79d01df8a33f357a8f574992adc45 /modules | |
parent | aef7a3178fb141bbbfafb52b275851ad70bab5a0 (diff) | |
parent | 4a0b4417a32d1d45f74be4bb781f55deacd10d5b (diff) |
Merge pull request #10446 from bojidar-bg/6583-fix-wait-node
Fix Condition + Wait nodes freezing the game
Diffstat (limited to 'modules')
-rw-r--r-- | modules/visual_script/visual_script.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index d1cf0f1dce..8cbfb8f3fd 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -1578,12 +1578,15 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p VisualScriptNodeInstance::StartMode start_mode; { - if (p_resuming_yield) + if (p_resuming_yield) { start_mode = VisualScriptNodeInstance::START_MODE_RESUME_YIELD; - else if (!flow_stack || !(flow_stack[flow_stack_pos] & VisualScriptNodeInstance::FLOW_STACK_PUSHED_BIT)) //if there is a push bit, it means we are continuing a sequence - start_mode = VisualScriptNodeInstance::START_MODE_BEGIN_SEQUENCE; - else + p_resuming_yield = false; // should resume only the first time + } else if (flow_stack && (flow_stack[flow_stack_pos] & VisualScriptNodeInstance::FLOW_STACK_PUSHED_BIT)) { + //if there is a push bit, it means we are continuing a sequence start_mode = VisualScriptNodeInstance::START_MODE_CONTINUE_SEQUENCE; + } else { + start_mode = VisualScriptNodeInstance::START_MODE_BEGIN_SEQUENCE; + } } VSDEBUG("STEP - STARTSEQ: " + itos(start_mode)); |