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.

33 lines
623 B

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "gametrace.h"
  8. #include "world.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. bool CGameTrace::DidHitWorld() const
  12. {
  13. return m_pEnt == GetWorldEntity();
  14. }
  15. bool CGameTrace::DidHitNonWorldEntity() const
  16. {
  17. return m_pEnt != NULL && !DidHitWorld();
  18. }
  19. int CGameTrace::GetEntityIndex() const
  20. {
  21. if ( m_pEnt )
  22. return m_pEnt->entindex();
  23. else
  24. return -1;
  25. }