Skip to content

Commit f2bbc8c

Browse files
I think I fixed it
1 parent 9248be2 commit f2bbc8c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

MLAPI/NetworkingManagerComponents/Binary/BitReader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ public byte ReadByte()
7070
public void SkipPadded() => bitCount += (8 - (bitCount % 8)) % 8;
7171
public ushort ReadUShort() => (ushort)ReadULong();
7272
public uint ReadUInt() => (uint)ReadULong();
73-
public sbyte ReadSByte() => (sbyte)ZigZagDecode(ReadByte());
74-
public short ReadShort() => (short)ZigZagDecode(ReadUShort());
75-
public int ReadInt() => (int)ZigZagDecode(ReadUInt());
73+
public sbyte ReadSByte() => (sbyte)ZigZagDecode(ReadULong());
74+
public short ReadShort() => (short)ZigZagDecode(ReadULong());
75+
public int ReadInt() => (int)ZigZagDecode(ReadULong());
7676
public long ReadLong() => ZigZagDecode(ReadULong());
7777

7878
public float[] ReadFloatArray(int known = -1) => ReadArray(ReadFloat, known);

MLAPI/NetworkingManagerComponents/Binary/BitWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ private static Type GetUnsignedType(Type t) =>
358358
t == typeof(int) ? typeof(uint) :
359359
t == typeof(long) ? typeof(ulong) :
360360
null;
361-
362-
public static ulong ZigZagEncode(long d) => (ulong)(((d >> 63)&1) | (d << 1));
361+
362+
public static ulong ZigZagEncode(long d) => (ulong)(((d >> 63) & 1) | (d << 1));
363363

364364
public static long GetBitCount<T>(T t)
365365
{

0 commit comments

Comments
 (0)