source-sdk-2013
source-sdk-2013 copied to clipboard
[HL2MP] Fix signed integer issue in BitForBitnum function
Issue: If we use signed integers, we end up holding negative numbers and this leads to certain number of issues, like incorrect handling of large values, as the sign bit may be interpreted incorrectly, causing wrong results.
Fix:
Therefore, we switch BitForBitnum to return an unsigned int instead of int to stop negative values from being returned and allow shifting above 31 bits.