summaryrefslogtreecommitdiff
path: root/hammer/maphelper.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /hammer/maphelper.cpp
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'hammer/maphelper.cpp')
-rw-r--r--hammer/maphelper.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/hammer/maphelper.cpp b/hammer/maphelper.cpp
new file mode 100644
index 0000000..cb68a22
--- /dev/null
+++ b/hammer/maphelper.cpp
@@ -0,0 +1,39 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#include "stdafx.h"
+#include "MapHelper.h"
+#include "mapworld.h"
+#include "globalfunctions.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include <tier0/memdbgon.h>
+
+
+//-----------------------------------------------------------------------------
+// Purpose: Returns the appropriate object to the selection code.
+// Input : dwFlags - selectPicky or selectNormal
+// Output : Returns a pointer to the object that should be selected, based on
+// the selection mode.
+//-----------------------------------------------------------------------------
+CMapClass *CMapHelper::PrepareSelection(SelectMode_t eSelectMode)
+{
+ //
+ // If we have a parent that is not the world, select our parent.
+ //
+ if (m_pParent && !IsWorldObject(m_pParent))
+ {
+ return GetParent()->PrepareSelection(eSelectMode);
+ }
+
+ //
+ // We should never have a helper as a child of the world!
+ //
+ Assert(false);
+ return NULL;
+}
+