Skip to content

Conversation

@BaconVN
Copy link

@BaconVN BaconVN commented Aug 8, 2024

我有 BP_Child 和 BP_Base,它们分别绑定到 Child.lua 和 Base.lua。Child.lua 和 Base.lua 都重写了 FunctionA()。当我在 BP_Child 中调用 FunctionA() 时,它导致了无限循环错误。根本原因是,当执行到 BP_Base 中的 FunctionA 时,由于 Base.lua 重写了 FunctionA(),UnLua 决定再次触发 FunctionA(),这就导致了一个无限循环。你可以看下面的图表来直观理解。

image
我在调用 LuaFunction 时添加了检查,判断调用的 ULuaFunction 是否来自父类,且与对象的 UClass 不是同一个类。这就是为什么我们跳过调用 Lua 端,而是调用被重写的函数,以防止继承相关的 bug。

@tencent-adm
Copy link
Member

tencent-adm commented Aug 8, 2024

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@DarcJC
Copy link

DarcJC commented May 23, 2025

不能这样修,这样会导致部分蓝图脚本字节码执行出问题从而导致偶现崩溃。建议还是直接从业务侧规避。

@TeamBaconn
Copy link

不能这样修,这样会导致部分蓝图脚本字节码执行出问题从而导致偶现崩溃。建议还是直接从业务侧规避。

@DarcJC, can you kindly provide an example case to reproduce the crash. So far we haven't encounter any crash since it will only redirect calls to the LUA side, not the intercepting the call stack from the Blueprint. The old flow do the same but with different call path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants