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.

45 lines
948 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "player.h"
  8. #include "items.h"
  9. #include "gamerules.h"
  10. #include "hl1_items.h"
  11. void CHL1Item::Spawn( void )
  12. {
  13. SetMoveType( MOVETYPE_FLYGRAVITY );
  14. SetSolid( SOLID_BBOX );
  15. AddSolidFlags( FSOLID_NOT_STANDABLE | FSOLID_TRIGGER );
  16. CollisionProp()->UseTriggerBounds( true, 24.0f );
  17. SetCollisionGroup( COLLISION_GROUP_DEBRIS );
  18. SetTouch( &CItem::ItemTouch );
  19. #ifdef HL1_DLL
  20. if ( g_pGameRules->IsMultiplayer() )
  21. AddEffects( EF_NOSHADOW );
  22. #endif
  23. }
  24. void CHL1Item::Activate( void )
  25. {
  26. BaseClass::Activate();
  27. if ( UTIL_DropToFloor( this, MASK_SOLID ) == 0 )
  28. {
  29. Warning( "Item %s fell out of level at %f,%f,%f\n", GetClassname(), GetAbsOrigin().x, GetAbsOrigin().y, GetAbsOrigin().z);
  30. UTIL_Remove( this );
  31. return;
  32. }
  33. }