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.

54 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #include "cbase.h"
  7. #include "tf_fx_shared.h"
  8. #include "c_basetempentity.h"
  9. #include "tier0/vprof.h"
  10. #include <cliententitylist.h>
  11. class C_TEFireBullets : public C_BaseTempEntity
  12. {
  13. public:
  14. DECLARE_CLASS( C_TEFireBullets, C_BaseTempEntity );
  15. DECLARE_CLIENTCLASS();
  16. virtual void PostDataUpdate( DataUpdateType_t updateType );
  17. public:
  18. int m_iPlayer;
  19. Vector m_vecOrigin;
  20. QAngle m_vecAngles;
  21. int m_iWeaponID;
  22. int m_iMode;
  23. int m_iSeed;
  24. float m_flSpread;
  25. bool m_bCritical;
  26. };
  27. IMPLEMENT_CLIENTCLASS_EVENT( C_TEFireBullets, DT_TEFireBullets, CTEFireBullets );
  28. BEGIN_RECV_TABLE_NOBASE( C_TEFireBullets, DT_TEFireBullets )
  29. RecvPropVector( RECVINFO( m_vecOrigin ) ),
  30. RecvPropFloat( RECVINFO( m_vecAngles[0] ) ),
  31. RecvPropFloat( RECVINFO( m_vecAngles[1] ) ),
  32. RecvPropInt( RECVINFO( m_iWeaponID ) ),
  33. RecvPropInt( RECVINFO( m_iMode ) ),
  34. RecvPropInt( RECVINFO( m_iSeed ) ),
  35. RecvPropInt( RECVINFO( m_iPlayer ) ),
  36. RecvPropFloat( RECVINFO( m_flSpread ) ),
  37. RecvPropInt( RECVINFO( m_bCritical ) ),
  38. END_RECV_TABLE()
  39. void C_TEFireBullets::PostDataUpdate( DataUpdateType_t updateType )
  40. {
  41. VPROF( "C_TEFireBullets::PostDataUpdate" );
  42. // Create the effect.
  43. m_vecAngles.z = 0;
  44. FX_FireBullets( NULL, m_iPlayer+1, m_vecOrigin, m_vecAngles, m_iWeaponID, m_iMode, m_iSeed, m_flSpread, -1, m_bCritical );
  45. }