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.

61 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "sdk_fx_shared.h"
  8. #include "c_sdk_player.h"
  9. #include "c_basetempentity.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. };
  26. void C_TEFireBullets::PostDataUpdate( DataUpdateType_t updateType )
  27. {
  28. // Create the effect.
  29. m_vecAngles.z = 0;
  30. FX_FireBullets(
  31. m_iPlayer+1,
  32. m_vecOrigin,
  33. m_vecAngles,
  34. m_iWeaponID,
  35. m_iMode,
  36. m_iSeed,
  37. m_flSpread );
  38. }
  39. IMPLEMENT_CLIENTCLASS_EVENT( C_TEFireBullets, DT_TEFireBullets, CTEFireBullets );
  40. BEGIN_RECV_TABLE_NOBASE(C_TEFireBullets, DT_TEFireBullets)
  41. RecvPropVector( RECVINFO( m_vecOrigin ) ),
  42. RecvPropFloat( RECVINFO( m_vecAngles[0] ) ),
  43. RecvPropFloat( RECVINFO( m_vecAngles[1] ) ),
  44. RecvPropInt( RECVINFO( m_iWeaponID ) ),
  45. RecvPropInt( RECVINFO( m_iMode ) ),
  46. RecvPropInt( RECVINFO( m_iSeed ) ),
  47. RecvPropInt( RECVINFO( m_iPlayer ) ),
  48. RecvPropFloat( RECVINFO( m_flSpread ) ),
  49. END_RECV_TABLE()