Esempio n. 1
0
//---------------------------------------------------------
// Purpose: Applies the desired relationships to an entity
//---------------------------------------------------------
void CAI_Relationship::ApplyRelationship( CBaseEntity *pActivator, CBaseEntity *pCaller )
{
	// @TODO (toml 10-22-04): sort out MP relationships 
	
	// The player spawns slightly after the NPCs, meaning that if we don't wait, the
	// player will miss any relationships placed on them.
	#ifdef SecobMod__Enable_Fixed_Multiplayer_AI
		if ( UTIL_GetLocalPlayer() ) 
		{
			SetThink( &CAI_Relationship::ApplyRelationshipThink );
			SetNextThink( gpGlobals->curtime );
		}
	#else
		if ( AI_IsSinglePlayer() && !UTIL_GetLocalPlayer() )
		{
			SetThink( &CAI_Relationship::ApplyRelationshipThink );
			SetNextThink( gpGlobals->curtime );
		}
	#endif //SecobMod__Enable_Fixed_Multiplayer_AI

	if ( !m_bIsActive )
	{
		SetActive( true );
	}

	ChangeRelationships( m_iDisposition, NOT_REVERTING, pActivator, pCaller );
}
Esempio n. 2
0
//---------------------------------------------------------
//---------------------------------------------------------
void CAI_Relationship::RevertToDefaultRelationship( CBaseEntity *pActivator, CBaseEntity *pCaller )
{
	if ( m_bIsActive )
	{
		ChangeRelationships( -1, REVERTING_TO_DEFAULT, pActivator, pCaller );
		SetActive( false );
	}
}
Esempio n. 3
0
//---------------------------------------------------------
//---------------------------------------------------------
void CAI_Relationship::RevertRelationship( CBaseEntity *pActivator, CBaseEntity *pCaller )
{
	if ( m_bIsActive )
	{
		ChangeRelationships( m_iPreviousDisposition, REVERTING_TO_PREV, pActivator, pCaller );
		SetActive( false );
	}
}