From 5281636de40b3946b2c779d31903e0ddf39c321b Mon Sep 17 00:00:00 2001 From: Thomas ten Cate Date: Mon, 2 Jul 2018 21:25:51 +0200 Subject: [PATCH] Document return value of yield() with signals Fixes godotengine/godot-docs#1478 (cherry picked from commit 117c666fcea1067c0fcefe4414fd1e530a65d622) --- doc/classes/@GDScript.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml index e3eceaa591c..ec7ee52da8a 100644 --- a/doc/classes/@GDScript.xml +++ b/doc/classes/@GDScript.xml @@ -1137,8 +1137,9 @@ - Stops the function execution and returns the current state. Call [method GDScriptFunctionState.resume] on the state to resume execution. This invalidates the state. - Returns anything that was passed to the resume function call. If passed an object and a signal, the execution is resumed when the object's signal is emitted. + Stops the function execution and returns the current suspended state to the calling function. + From the caller, call [method GDScriptFunctionState.resume] on the state to resume execution. This invalidates the state. Within the resumed function, [code]yield()[/code] returns whatever was passed to the [code]resume()[/code] function call. + If passed an object and a signal, the execution is resumed when the object emits the given signal. In this case, [code]yield()[/code] returns the argument passed to [code]emit_signal()[/code] if the signal takes only one argument, or an array containing all the arguments passed to [code]emit_signal()[/code] if the signal takes multiple arguments.