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.

39 lines
1.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "stdafx.h"
  8. #include "MapHelper.h"
  9. #include "mapworld.h"
  10. #include "globalfunctions.h"
  11. // memdbgon must be the last include file in a .cpp file!!!
  12. #include <tier0/memdbgon.h>
  13. //-----------------------------------------------------------------------------
  14. // Purpose: Returns the appropriate object to the selection code.
  15. // Input : dwFlags - selectPicky or selectNormal
  16. // Output : Returns a pointer to the object that should be selected, based on
  17. // the selection mode.
  18. //-----------------------------------------------------------------------------
  19. CMapClass *CMapHelper::PrepareSelection(SelectMode_t eSelectMode)
  20. {
  21. //
  22. // If we have a parent that is not the world, select our parent.
  23. //
  24. if (m_pParent && !IsWorldObject(m_pParent))
  25. {
  26. return GetParent()->PrepareSelection(eSelectMode);
  27. }
  28. //
  29. // We should never have a helper as a child of the world!
  30. //
  31. Assert(false);
  32. return NULL;
  33. }