You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-15 22:56:30 +09:00
Fix for WriteByte outputting too many bits, unit test added
This commit is contained in:
@@ -105,7 +105,7 @@ namespace Lidgren.Network
|
||||
NetException.Assert(((numberOfBits >= 1) && (numberOfBits <= 8)), "Must write between 1 and 8 bits!");
|
||||
|
||||
// mask out unwanted bits in the source
|
||||
byte isrc = (byte)((uint)source & ((~(uint)0) >> (8 - numberOfBits)));
|
||||
byte isrc = (byte)(source & (0x000000FF >> (8 - numberOfBits)));
|
||||
|
||||
int bytePtr = destBitOffset >> 3;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user