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.

57 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #include "cbase.h"
  14. #include "ai_link.h"
  15. // memdbgon must be the last include file in a .cpp file!!!
  16. #include "tier0/memdbgon.h"
  17. ASSERT_INVARIANT( ( bits_LINK_STALE_SUGGESTED | bits_LINK_OFF ) <= 255 && ( AI_MOVE_TYPE_BITS <= 255 ) );
  18. //-----------------------------------------------------------------------------
  19. // Purpose: Given the source node ID, returns the destination ID
  20. // Input :
  21. // Output :
  22. //-----------------------------------------------------------------------------
  23. int CAI_Link::DestNodeID(int srcID)
  24. {
  25. if (srcID == m_iSrcID)
  26. {
  27. return m_iDestID;
  28. }
  29. else
  30. {
  31. return m_iSrcID;
  32. }
  33. }
  34. //-----------------------------------------------------------------------------
  35. // Purpose: Constructor
  36. // Input :
  37. // Output :
  38. //-----------------------------------------------------------------------------
  39. CAI_Link::CAI_Link(void)
  40. {
  41. m_iSrcID = -1;
  42. m_iDestID = -1;
  43. m_LinkInfo = 0;
  44. m_timeStaleExpires = 0;
  45. m_pDynamicLink = NULL;
  46. for (int hull=0;hull<NUM_HULLS;hull++)
  47. {
  48. m_iAcceptedMoveTypes[hull] = 0;
  49. }
  50. };