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)
108108 if ( type == typeof ( double ) )
109109 return ReadDoublePacked ( ) ;
110110 if ( type == typeof ( string ) )
111- return ReadStringPacked ( ) ;
111+ return ReadStringPacked ( ) . ToString ( ) ;
112112 if ( type == typeof ( bool ) )
113113 return ReadBool ( ) ;
114114 if ( type == typeof ( Vector2 ) )
@@ -127,14 +127,14 @@ public object ReadObjectPacked(Type type)
127127 return ReadRotation ( 3 ) ;
128128 if ( type == typeof ( char ) )
129129 return ReadCharPacked ( ) ;
130- if ( type == typeof ( IBitWritable ) )
130+ if ( type . IsEnum )
131+ return ReadInt32Packed ( ) ;
132+ if ( typeof ( IBitWritable ) . IsAssignableFrom ( type ) )
131133 {
132134 object instance = Activator . CreateInstance ( type ) ;
133135 ( ( IBitWritable ) instance ) . Read ( this . source ) ;
134136 return instance ;
135137 }
136- if ( type . IsEnum )
137- return ReadInt32Packed ( ) ;
138138
139139 throw new ArgumentException ( "BitReader cannot read type " + type . Name ) ;
140140 }
You can’t perform that action at this time.
0 commit comments