Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "cbase.h"
  8. #include "hl2_playerlocaldata.h"
  9. #include "hl2_player.h"
  10. #include "mathlib/mathlib.h"
  11. #include "entitylist.h"
  12. // memdbgon must be the last include file in a .cpp file!!!
  13. #include "tier0/memdbgon.h"
  14. BEGIN_SEND_TABLE_NOBASE( CHL2PlayerLocalData, DT_HL2Local )
  15. SendPropFloat( SENDINFO(m_flSuitPower), 10, SPROP_UNSIGNED | SPROP_ROUNDUP, 0.0, 100.0 ),
  16. SendPropInt( SENDINFO(m_bZooming), 1, SPROP_UNSIGNED ),
  17. SendPropInt( SENDINFO(m_bitsActiveDevices), MAX_SUIT_DEVICES, SPROP_UNSIGNED ),
  18. SendPropInt( SENDINFO(m_iSquadMemberCount) ),
  19. SendPropInt( SENDINFO(m_iSquadMedicCount) ),
  20. SendPropBool( SENDINFO(m_fSquadInFollowMode) ),
  21. SendPropBool( SENDINFO(m_bWeaponLowered) ),
  22. SendPropEHandle( SENDINFO(m_hAutoAimTarget) ),
  23. SendPropVector( SENDINFO(m_vecAutoAimPoint) ),
  24. SendPropEHandle( SENDINFO(m_hLadder) ),
  25. SendPropBool( SENDINFO(m_bDisplayReticle) ),
  26. SendPropBool( SENDINFO(m_bStickyAutoAim) ),
  27. SendPropBool( SENDINFO(m_bAutoAimTarget) ),
  28. #ifdef HL2_EPISODIC
  29. SendPropFloat( SENDINFO(m_flFlashBattery) ),
  30. SendPropVector( SENDINFO(m_vecLocatorOrigin) ),
  31. #endif
  32. END_SEND_TABLE()
  33. BEGIN_SIMPLE_DATADESC( CHL2PlayerLocalData )
  34. DEFINE_FIELD( m_flSuitPower, FIELD_FLOAT ),
  35. DEFINE_FIELD( m_bZooming, FIELD_BOOLEAN ),
  36. DEFINE_FIELD( m_bitsActiveDevices, FIELD_INTEGER ),
  37. DEFINE_FIELD( m_iSquadMemberCount, FIELD_INTEGER ),
  38. DEFINE_FIELD( m_iSquadMedicCount, FIELD_INTEGER ),
  39. DEFINE_FIELD( m_fSquadInFollowMode, FIELD_BOOLEAN ),
  40. DEFINE_FIELD( m_bWeaponLowered, FIELD_BOOLEAN ),
  41. DEFINE_FIELD( m_bDisplayReticle, FIELD_BOOLEAN ),
  42. DEFINE_FIELD( m_bStickyAutoAim, FIELD_BOOLEAN ),
  43. #ifdef HL2_EPISODIC
  44. DEFINE_FIELD( m_flFlashBattery, FIELD_FLOAT ),
  45. DEFINE_FIELD( m_vecLocatorOrigin, FIELD_POSITION_VECTOR ),
  46. #endif
  47. // Ladder related stuff
  48. DEFINE_FIELD( m_hLadder, FIELD_EHANDLE ),
  49. DEFINE_EMBEDDED( m_LadderMove ),
  50. END_DATADESC()
  51. CHL2PlayerLocalData::CHL2PlayerLocalData()
  52. {
  53. m_flSuitPower = 0.0;
  54. m_bZooming = false;
  55. m_bWeaponLowered = false;
  56. m_hAutoAimTarget.Set(NULL);
  57. m_hLadder.Set(NULL);
  58. m_vecAutoAimPoint.GetForModify().Init();
  59. m_bDisplayReticle = false;
  60. #ifdef HL2_EPISODIC
  61. m_flFlashBattery = 0.0f;
  62. #endif
  63. }