Counter Strike : Global Offensive Source Code
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.

31 lines
878 B

  1. //========= Copyright � 2011-2011, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: No defuse area
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "cs_player.h"
  8. #include "func_no_defuse.h"
  9. LINK_ENTITY_TO_CLASS( func_no_defuse, CNoDefuseArea );
  10. BEGIN_DATADESC( CNoDefuseArea )
  11. DEFINE_FUNCTION( NoDefuseAreaTouch ),
  12. END_DATADESC()
  13. void CNoDefuseArea::Spawn()
  14. {
  15. InitTrigger();
  16. SetTouch( &CNoDefuseArea::NoDefuseAreaTouch );
  17. }
  18. void CNoDefuseArea::NoDefuseAreaTouch( CBaseEntity* pOther )
  19. {
  20. CCSPlayer *player = dynamic_cast< CCSPlayer* >( pOther );
  21. // CT players are not allowed to defuse a bomb when they are in a no defuse zone.
  22. // the is to help prevent bugs with CTs being able to defuse bombs through walls and floors etc.
  23. if ( player )
  24. {
  25. player->m_bInNoDefuseArea = true;
  26. }
  27. }