Skip to content

Unsigned NetIDs

Sean Baggaley requested to merge topic/default/netid-unsigned into branch/default

This converts NetIDs to use unsigned short, and additionally replaces the use of -1 to represent a lack of a NetID with 0, increasing the NetID limit from 32767 to 65535.

This is mostly @akmdm's work from a while ago. I fixed a bug where shorts were immediately read into an unsigned int causing them to be sign-extended into some obscenely huge value: for example, 41234 would be read as -24302, which would end up as 4294942994; which is obviously an invalid NetID. For this I amended the protocol spec to add a new NetID type to the protocol spec for when they are referenced directly, and updated the Actor type, so that the value is cast to the correct type before storing it. It might be worth extending this to UShort as well but since other things use it I decided to do it this way to not risk breaking other things.

There's also some other fixes atop Kaminsky's original changes.

I've tested this topic with stress testing maps, and with other people on actual maps that have ridiculous monster counts that hit the 32K limit, without issues.

Edited by Sean Baggaley

Merge request reports

Loading