File tree Expand file tree Collapse file tree
src/core/modules/entities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -857,6 +857,19 @@ void CBaseEntityWrapper::SetColor(Color& color)
857857}
858858
859859
860+ QAngle CBaseEntityWrapper::GetRotation ()
861+ {
862+ static int offset = FindDatamapPropertyOffset (" m_angRotation" );
863+ return GetNetworkPropertyByOffset<QAngle>(offset);
864+ }
865+
866+ void CBaseEntityWrapper::SetRotation (QAngle& rotation)
867+ {
868+ static int offset = FindDatamapPropertyOffset (" m_angRotation" );
869+ SetNetworkPropertyByOffset<QAngle>(offset, rotation);
870+ }
871+
872+
860873Vector CBaseEntityWrapper::GetEyeLocation ()
861874{
862875 return GetOrigin () + GetViewOffset ();
Original file line number Diff line number Diff line change @@ -350,6 +350,9 @@ class CBaseEntityWrapper: public IServerEntity
350350 Color GetColor ();
351351 void SetColor (Color& color);
352352
353+ QAngle GetRotation ();
354+ void SetRotation (QAngle& rotation);
355+
353356 Vector GetEyeLocation ();
354357
355358 void StopSound (const char * sample, int channel);
Original file line number Diff line number Diff line change @@ -404,6 +404,14 @@ void export_base_entity(scope _entity)
404404 " :rtype: Color"
405405 );
406406
407+ BaseEntity.add_property (
408+ " rotation" ,
409+ &CBaseEntityWrapper::GetRotation,
410+ &CBaseEntityWrapper::SetRotation,
411+ " Get/set the entity's rotation.\n\n "
412+ " :rtype: QAngle"
413+ );
414+
407415 BaseEntity.def (
408416 " get_eye_location" ,
409417 &CBaseEntityWrapper::GetEyeLocation,
You can’t perform that action at this time.
0 commit comments