mirror of
https://github.com/godotengine/godot.git
synced 2025-10-23 18:03:35 +00:00
Merge pull request #44104 from nekomatata/coroutine-await-fix
Fix error when calling coroutine with await in _ready
This commit is contained in:
commit
c17413f159
4 changed files with 23 additions and 2 deletions
|
|
@ -494,9 +494,17 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
|
|||
} else if ((codegen.function_node && codegen.function_node->is_static) || call->function_name == "new") {
|
||||
GDScriptCodeGenerator::Address self;
|
||||
self.mode = GDScriptCodeGenerator::Address::CLASS;
|
||||
gen->write_call(result, self, call->function_name, arguments);
|
||||
if (within_await) {
|
||||
gen->write_call_async(result, self, call->function_name, arguments);
|
||||
} else {
|
||||
gen->write_call(result, self, call->function_name, arguments);
|
||||
}
|
||||
} else {
|
||||
gen->write_call_self(result, call->function_name, arguments);
|
||||
if (within_await) {
|
||||
gen->write_call_self_async(result, call->function_name, arguments);
|
||||
} else {
|
||||
gen->write_call_self(result, call->function_name, arguments);
|
||||
}
|
||||
}
|
||||
} else if (callee->type == GDScriptParser::Node::SUBSCRIPT) {
|
||||
const GDScriptParser::SubscriptNode *subscript = static_cast<const GDScriptParser::SubscriptNode *>(call->callee);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue