@@ -39,8 +39,8 @@ static Binary()
3939 } ;
4040 SupportedAttributes [ 9 ] = new Type [ ] {
4141 typeof ( Element ) , typeof ( int ) , typeof ( float ) , typeof ( bool ) , typeof ( string ) , typeof ( byte [ ] ) ,
42- typeof ( TimeSpan ) , typeof ( Color ) , typeof ( Vector2 ) , typeof ( Vector3 ) , typeof ( Vector4 ) , typeof ( Vector3 ) /* angle*/ , typeof ( Quaternion ) , typeof ( Matrix4x4 ) ,
43- typeof ( ulong ) , typeof ( byte ) /*, typeof(QAngle) */
42+ typeof ( TimeSpan ) , typeof ( Color ) , typeof ( Vector2 ) , typeof ( Vector3 ) , typeof ( Vector4 ) , typeof ( QAngle ) , typeof ( Quaternion ) , typeof ( Matrix4x4 ) ,
43+ typeof ( ulong ) , typeof ( byte )
4444 } ;
4545 }
4646
@@ -288,6 +288,12 @@ object ReadValue(Datamodel dm, Type type, bool raw_string)
288288 var ords = ReadVector ( 3 ) ;
289289 return new Vector3 ( ords [ 0 ] , ords [ 1 ] , ords [ 2 ] ) ;
290290 }
291+ if ( type == typeof ( QAngle ) )
292+ {
293+ var ords = ReadVector ( 3 ) ;
294+ return new QAngle ( ords [ 0 ] , ords [ 1 ] , ords [ 2 ] ) ;
295+ }
296+
291297 if ( type == typeof ( Vector4 ) )
292298 {
293299 var ords = ReadVector ( 4 ) ;
@@ -655,6 +661,13 @@ void WriteAttribute(object value, bool in_array)
655661 Writer . Write ( vector3 . Z ) ;
656662 return ;
657663 }
664+ if ( value is QAngle qangle )
665+ {
666+ Writer . Write ( qangle . Pitch ) ;
667+ Writer . Write ( qangle . Yaw ) ;
668+ Writer . Write ( qangle . Roll ) ;
669+ return ;
670+ }
658671 if ( value is Vector4 vector4 )
659672 {
660673 Writer . Write ( vector4 . X ) ;
0 commit comments