当有更多的鱼人守卫时,他们无法攻击目标,导致游戏崩溃。核心问题在于用于计算攻击范围的 Lua 脚本,其中目标变为 nil,导致方法调用失败。
错误源:
错误出现在 combat.lua 的 CalcAttackRangeSq 方法中(第 1028 行),需要一个 target 参数来计算攻击范围。当 target 为 nil 时,脚本无法执行后续逻辑,从而导致崩溃。
调用链路径:
CalcAttackRangeSq 由 mermguardbrain.lua 中的 target_dist_fn 调用。target_dist_fn 是 mermguard 行为树逻辑的一部分,用于计算到目标(例如敌人或特定实体)的距离。
该错误最终在行为树 (behaviourtree.lua) 中的节点遍历过程中触发,从而破坏了逻辑。
关键提示:
调用 CalcAttackRangeSq 时,target 参数要么没有正确传递,要么没有正确检索。日志显示 target = nil,但 mermguard 的目标可能指向触手或其他可能已经消失或未正确初始化的实体。
Steps to Reproduce
创建新世界设置 大量 鱼人,找到沼泽,创建 20~30 个鱼人 守卫,与随机 Boss 战斗,
-
2
A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now