File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
MLAPI/NetworkingManagerComponents/Binary Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ public object ReadObjectPacked(Type type)
108
108
if ( type == typeof ( double ) )
109
109
return ReadDoublePacked ( ) ;
110
110
if ( type == typeof ( string ) )
111
- return ReadStringPacked ( ) ;
111
+ return ReadStringPacked ( ) . ToString ( ) ;
112
112
if ( type == typeof ( bool ) )
113
113
return ReadBool ( ) ;
114
114
if ( type == typeof ( Vector2 ) )
@@ -127,14 +127,14 @@ public object ReadObjectPacked(Type type)
127
127
return ReadRotation ( 3 ) ;
128
128
if ( type == typeof ( char ) )
129
129
return ReadCharPacked ( ) ;
130
- if ( type == typeof ( IBitWritable ) )
130
+ if ( type . IsEnum )
131
+ return ReadInt32Packed ( ) ;
132
+ if ( typeof ( IBitWritable ) . IsAssignableFrom ( type ) )
131
133
{
132
134
object instance = Activator . CreateInstance ( type ) ;
133
135
( ( IBitWritable ) instance ) . Read ( this . source ) ;
134
136
return instance ;
135
137
}
136
- if ( type . IsEnum )
137
- return ReadInt32Packed ( ) ;
138
138
139
139
throw new ArgumentException ( "BitReader cannot read type " + type . Name ) ;
140
140
}
You can’t perform that action at this time.
0 commit comments