Jump to content

wx-78在客机无法激活格挡(偶现)


HengZi
  • Pending

问题描述:wx-78在使用格挡插件后,在客机上可能会出现无法右键点击自身进入格挡状态的问题。

根本原因:这个问题应该是entityscript.lua中的entity对象的inst.actionreplica.inherentactions使用了net_bytearray这个网络变量引起的, net_bytearray只支持8-bit unsigned integers,也就是只支持[0,255],而目前ACTIONS里的动作数量已经达到299个了,加了mod会更多,当pairs拿到的ACTIONS.TOGGLEWXSHIELDING的id>255时,客机就无法正常同步对应的动作ID了。

解决方法:把inst.actionreplica.inherentactions改为net_ushortarray


Steps to Reproduce

激活格挡插件的时候,会使用AddInherentAction方法给wx78_classified绑定ACTIONS.TOGGLEWXSHIELDING动作

image.png.fb4b5a299a92a9f293a8d796bbe073b3.png

然后在AddInherentAction中会调用SerializeInherentActions函数来对主客机的绑定动作进行同步

image.png.93bef8290f1cbdbf0eeaa99b2a06b12c.png

此时会使用pairs迭代器遍历ACTIONS表,然后将对应的id存入inst.actionreplica.inherentactions来同步到客户端,而inst.actionreplica.inherentactions是一个net_bytearray,只能存入[0,255]的数字,当动作id大于255时就会出现问题,客机无法正常同步对应的动作ID,从而导致对应的动作无法正常被激活。

image.png.a42777f52795046f551401d0c2b1c548.png

目前光饥荒联机版本身的动作数量就已经超过255个了,如果开了模组的话会更多,出现这个问题的概率也会更大

image.png.b8b51a3c5a53f20d9b14a6a72970ad12.png

image.png




User Feedback


There are no comments to display.



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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...