summaryrefslogtreecommitdiff
path: root/game/server/tf/bot/map_entities/tf_bot_hint_entity.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 /game/server/tf/bot/map_entities/tf_bot_hint_entity.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/server/tf/bot/map_entities/tf_bot_hint_entity.cpp')
-rw-r--r--game/server/tf/bot/map_entities/tf_bot_hint_entity.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/game/server/tf/bot/map_entities/tf_bot_hint_entity.cpp b/game/server/tf/bot/map_entities/tf_bot_hint_entity.cpp
new file mode 100644
index 0000000..ffd2c74
--- /dev/null
+++ b/game/server/tf/bot/map_entities/tf_bot_hint_entity.cpp
@@ -0,0 +1,60 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//
+//
+//=============================================================================
+#include "cbase.h"
+#include "tf_bot_hint_entity.h"
+#include "tf_obj.h"
+#include "tf_player.h"
+
+
+BEGIN_DATADESC( CBaseTFBotHintEntity )
+ DEFINE_KEYFIELD( m_isDisabled, FIELD_BOOLEAN, "StartDisabled" ),
+ DEFINE_INPUTFUNC( FIELD_VOID, "Enable", InputEnable ),
+ DEFINE_INPUTFUNC( FIELD_VOID, "Disable", InputDisable ),
+END_DATADESC()
+
+IMPLEMENT_AUTO_LIST( ITFBotHintEntityAutoList );
+
+//------------------------------------------------------------------------------
+CBaseTFBotHintEntity::CBaseTFBotHintEntity( void )
+ : m_isDisabled( false ),
+ m_hintType( HINT_INVALID )
+{
+}
+
+
+bool CBaseTFBotHintEntity::OwnerObjectHasNoOwner() const
+{
+ CBaseEntity* pOwner = GetOwnerEntity();
+ if ( pOwner && pOwner->IsBaseObject() )
+ {
+ CBaseObject *pObj = static_cast< CBaseObject* >( pOwner );
+ if ( pObj->GetBuilder() == NULL )
+ {
+ return true;
+ }
+ else
+ {
+ if ( !pObj->GetBuilder()->IsPlayerClass( TF_CLASS_ENGINEER ) )
+ {
+ AssertMsg( 0, "Object has an owner that's not engineer." );
+ Warning( "Object has an owner that's not engineer." );
+ }
+ }
+ }
+ return false;
+}
+
+
+bool CBaseTFBotHintEntity::OwnerObjectFinishBuilding() const
+{
+ CBaseEntity* pOwner = GetOwnerEntity();
+ if ( pOwner && pOwner->IsBaseObject() )
+ {
+ CBaseObject *pObj = static_cast< CBaseObject* >( pOwner );
+ return !pObj->IsBuilding();
+ }
+ return false;
+}