Tencent / sluaunreal

lua dev plugin for unreal engine 4 or 5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

在关卡蓝图中引用Actor运行lua actor函数会crash

gunsungithub opened this issue · comments

Describe the bug
将luaActor子类放入关卡,在关卡蓝图中引用它,并调用有lua版本的函数,导致崩溃。

Version
lua 2.0.1
UE 5.1

To Reproduce
制作一个名为BP_MyLuaActor的蓝图,父类为AMyLuaActor
CDO中配置好lua路径
放置到关卡中,如下图执行

class DEMOCPP_API AMyLuaActor : public ALuaActor
{
	GENERATED_BODY()

public:
	UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
	void MyNaciveFunctionLua(float FloatParameter, int32 IntParameter);

	void MyNaciveFunctionLua_Implementation(float FloatParameter, int32 IntParameter);
};
local BP_MyLuaActor = {}

function BP_MyLuaActor:MyNaciveFunctionLua(float, int)
    print("called from MyNaciveFunctionLua", float, int)
end

local CLuaActor = require("MyLuaActor")
return Class(CLuaActor, nil, BP_MyLuaActor)

Expected behavior
不崩溃并执行lua版本函数

Screenshots
image

Crash

for (auto it = (FProperty*)func->Children; *Stack.Code != EX_EndFunctionParms; it = (FProperty*)it->Next)

调试下来,是因为这里的Children为空,改为ChildProperties就好了。

Desktop (please complete the following information):

  • OS: Windows

Additional context
大佬看看怎么改吧

感谢反馈,这个应该是版本兼容问题,4.18应该是用Children,高版本用ChildProperties

感谢反馈,这个应该是版本兼容问题,4.18应该是用Children,高版本用ChildProperties

可以关注下我个人分支,我编译验证后,估计今晚8点前提交