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.

50 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Base class for object upgrading objects
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "baseobject_shared.h"
  8. #include "tf_obj_baseupgrade_shared.h"
  9. IMPLEMENT_NETWORKCLASS_ALIASED( BaseObjectUpgrade, DT_BaseObjectUpgrade )
  10. BEGIN_NETWORK_TABLE( CBaseObjectUpgrade, DT_BaseObjectUpgrade )
  11. END_NETWORK_TABLE()
  12. //-----------------------------------------------------------------------------
  13. // Purpose:
  14. //-----------------------------------------------------------------------------
  15. CBaseObjectUpgrade::CBaseObjectUpgrade()
  16. {
  17. UseClientSideAnimation();
  18. }
  19. //-----------------------------------------------------------------------------
  20. // Purpose:
  21. //-----------------------------------------------------------------------------
  22. void CBaseObjectUpgrade::Spawn()
  23. {
  24. #if !defined( CLIENT_DLL )
  25. m_fObjectFlags.Set( m_fObjectFlags | OF_MUST_BE_BUILT_ON_ATTACHMENT );
  26. #endif
  27. BaseClass::Spawn();
  28. #if !defined( CLIENT_DLL )
  29. SetCollisionGroup( TFCOLLISION_GROUP_COMBATOBJECT );
  30. #endif
  31. }
  32. //-----------------------------------------------------------------------------
  33. // Purpose: Prevent Team Damage
  34. //-----------------------------------------------------------------------------
  35. int CBaseObjectUpgrade::OnTakeDamage( const CTakeDamageInfo &info )
  36. {
  37. #if !defined( CLIENT_DLL )
  38. return BaseClass::OnTakeDamage( info );
  39. #else
  40. return 0;
  41. #endif
  42. }