Add 'ParseReturnValuesOnly' to the lua prototype parser.

This commit is contained in:
2026-03-04 17:50:18 -05:00
parent 4dabb98d05
commit 78f0f318c5
4 changed files with 64 additions and 31 deletions

View File

@@ -72,7 +72,7 @@ void UK2Node_LuaInvoke::AllocateDefaultPins()
// Note that we use the saved value of the function
// prototype, because the function prototype pin
// has been deleted at this point.
FlxParsedProto ParsedProto(LuaFunctionPrototype);
FlxParsedProto ParsedProto = FlxParsedProto::ParsePrototype(LuaFunctionPrototype);
if (!ParsedProto.ErrorMessage.IsEmpty())
{
SetErrorMsg(FString::Printf(TEXT("Syntax error in lua function prototype: %s"), *ParsedProto.ErrorMessage));
@@ -164,7 +164,7 @@ void UK2Node_LuaInvoke::ExpandNode(class FKismetCompilerContext& CompilerContext
{
Super::ExpandNode(CompilerContext, SourceGraph);
// The BeginNode function packs the class name and function name into the call buffer.
FlxParsedProto ParsedProto(LuaFunctionPrototype);
FlxParsedProto ParsedProto = FlxParsedProto::ParsePrototype(LuaFunctionPrototype);
const UEdGraphSchema_K2* CCSchema = CompilerContext.GetSchema();
UK2Node_CallFunction* BeginNode = MakeCallFunctionNode(CompilerContext, SourceGraph, LuaCallLibraryFunction(LuaCallBegin));
CCSchema->TrySetDefaultValue(*BeginNode->FindPinChecked(TEXT("ClassName")), ParsedProto.ClassName);