We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91e84f2 commit f31b3ecCopy full SHA for f31b3ec
2 files changed
MLAPI/NetworkingManagerComponents/Binary/BitReader.cs
@@ -127,6 +127,8 @@ public object ReadObjectPacked(Type type)
127
return ReadRotation(3);
128
if (type == typeof(char))
129
return ReadCharPacked();
130
+ if (type.IsEnum)
131
+ return ReadInt32Packed();
132
throw new ArgumentException("BitReader cannot read type " + type.Name);
133
}
134
MLAPI/NetworkingManagerComponents/Binary/BitWriter.cs
@@ -145,6 +145,11 @@ public void WriteObjectPacked(object value)
145
WriteCharPacked((char)value);
146
return;
147
148
+ else if (value.GetType().IsEnum)
149
+ {
150
+ WriteInt32Packed((int)value);
151
+ return;
152
+ }
153
154
throw new ArgumentException("BitWriter cannot write type " + value.GetType().Name);
155
0 commit comments