diff options
author | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2019-08-28 11:15:43 +0300 |
---|---|---|
committer | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2019-08-28 11:15:43 +0300 |
commit | 112aa6e367e4115114f0bf2145c9f988beb7bcfa (patch) | |
tree | a6a11b771eb29b8b92769c12409b3d9cb78b37ee /modules/gdscript/gdscript_function.cpp | |
parent | 538328898b7022c029134ffc94aac6edbda5a12f (diff) |
Fix yield check in GDScriptFunction
Fixes #31455
Diffstat (limited to 'modules/gdscript/gdscript_function.cpp')
-rw-r--r-- | modules/gdscript/gdscript_function.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index dc0e64fd03..68f2a9473e 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -431,6 +431,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a profile.frame_call_count++; } bool exit_ok = false; + bool yielded = false; #endif #ifdef DEBUG_ENABLED @@ -1323,6 +1324,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a #ifdef DEBUG_ENABLED exit_ok = true; + yielded = true; #endif OPCODE_BREAK; } @@ -1589,8 +1591,6 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a GDScriptLanguage::get_singleton()->script_frame_time += time_taken - function_call_time; } - bool yielded = retvalue.is_ref() && Object::cast_to<GDScriptFunctionState>(retvalue); - // Check if this is the last time the function is resuming from yield // Will be true if never yielded as well // When it's the last resume it will postpone the exit from stack, |