Ejemplo n.º 1
0
static void ConnectRightVertex( TESStesselator *tess, ActiveRegion *regUp,
							   TESShalfEdge *eBottomLeft )
/*
* Purpose: connect a "right" vertex vEvent (one where all edges go left)
* to the unprocessed portion of the mesh.  Since there are no right-going
* edges, two regions (one above vEvent and one below) are being merged
* into one.  "regUp" is the upper of these two regions.
*
* There are two reasons for doing this (adding a right-going edge):
*  - if the two regions being merged are "inside", we must add an edge
*    to keep them separated (the combined region would not be monotone).
*  - in any case, we must leave some record of vEvent in the dictionary,
*    so that we can merge vEvent with features that we have not seen yet.
*    For example, maybe there is a vertical edge which passes just to
*    the right of vEvent; we would like to splice vEvent into this edge.
*
* However, we don't want to connect vEvent to just any vertex.  We don''t
* want the new edge to cross any other edges; otherwise we will create
* intersection vertices even when the input data had no self-intersections.
* (This is a bad thing; if the user's input data has no intersections,
* we don't want to generate any false intersections ourselves.)
*
* Our eventual goal is to connect vEvent to the leftmost unprocessed
* vertex of the combined region (the union of regUp and regLo).
* But because of unseen vertices with all right-going edges, and also
* new vertices which may be created by edge intersections, we don''t
* know where that leftmost unprocessed vertex is.  In the meantime, we
* connect vEvent to the closest vertex of either chain, and mark the region
* as "fixUpperEdge".  This flag says to delete and reconnect this edge
* to the next processed vertex on the boundary of the combined region.
* Quite possibly the vertex we connected to will turn out to be the
* closest one, in which case we won''t need to make any changes.
*/
{
	TESShalfEdge *eNew;
	TESShalfEdge *eTopLeft = eBottomLeft->Onext;
	ActiveRegion *regLo = RegionBelow(regUp);
	TESShalfEdge *eUp = regUp->eUp;
	TESShalfEdge *eLo = regLo->eUp;
	int degenerate = FALSE;

	if( eUp->Dst != eLo->Dst ) {
		(void) CheckForIntersect( tess, regUp );
	}

	/* Possible new degeneracies: upper or lower edge of regUp may pass
	* through vEvent, or may coincide with new intersection vertex
	*/
	if( VertEq( eUp->Org, tess->event )) {
		if ( !tessMeshSplice( tess->mesh, eTopLeft->Oprev, eUp ) ) longjmp(tess->env,1);
		regUp = TopLeftRegion( tess, regUp );
		if (regUp == NULL) longjmp(tess->env,1);
		eTopLeft = RegionBelow( regUp )->eUp;
		FinishLeftRegions( tess, RegionBelow(regUp), regLo );
		degenerate = TRUE;
	}
	if( VertEq( eLo->Org, tess->event )) {
		if ( !tessMeshSplice( tess->mesh, eBottomLeft, eLo->Oprev ) ) longjmp(tess->env,1);
		eBottomLeft = FinishLeftRegions( tess, regLo, NULL );
		degenerate = TRUE;
	}
	if( degenerate ) {
		AddRightEdges( tess, regUp, eBottomLeft->Onext, eTopLeft, eTopLeft, TRUE );
		return;
	}

	/* Non-degenerate situation -- need to add a temporary, fixable edge.
	* Connect to the closer of eLo->Org, eUp->Org.
	*/
	if( VertLeq( eLo->Org, eUp->Org )) {
		eNew = eLo->Oprev;
	} else {
		eNew = eUp;
	}
	eNew = tessMeshConnect( tess->mesh, eBottomLeft->Lprev, eNew );
	if (eNew == NULL) longjmp(tess->env,1);

	/* Prevent cleanup, otherwise eNew might disappear before we've even
	* had a chance to mark it as a temporary edge.
	*/
	AddRightEdges( tess, regUp, eNew, eNew->Onext, eNew->Onext, FALSE );
	eNew->Sym->activeRegion->fixUpperEdge = TRUE;
	WalkDirtyRegions( tess, regUp );
}
Ejemplo n.º 2
0
void CTargetMgr::Update()
{
	
	// Do any necessary initialization...

	if (m_bFirstUpdate)
	{
		FirstUpdate();
		m_bFirstUpdate = false;
	}


	if (m_hLockedTarget && m_hTarget == m_hLockedTarget)
	{
		//are we disabling a GadgetTarget?
		if (g_pPlayerMgr->IsDisabling())
		{
			SetGadgetTarget( true );
			return;
		}

		//are we searching something?
		if (g_pPlayerMgr->IsSearching())
		{
			m_bSearchTarget = true;
			SetTargetStringID(IDS_TARGET_SEARCHING);
			
			float fDistAway = 10000.0f;
			CheckForIntersect(fDistAway);
			
			return;
		}
	}

	g_pPlayerStats->UpdateMaxProgress( 0 );
	g_pPlayerStats->UpdateProgress( 0 );
	g_pHUDMgr->QueueUpdate( kHUDProgressBar );


	// If we currently have a target, see if it is a body and if so remove the
	// glow flag (it may be set again below)...
	if (m_hTarget)
	{
		CBodyFX* pBody = g_pGameClientShell->GetSFXMgr()->GetBodyFX(m_hTarget);
		if (pBody) 
		{
			g_pCommonLT->SetObjectFlags(m_hTarget, OFT_User, 0, USRFLG_GLOW);
		}
	}


	// Start fresh
	ClearTargetInfo();


	//see what we've looking at
	float fDistAway = 10000.0f;
	CheckForIntersect(fDistAway);
	if (!m_hTarget) 
	{
		//nothing to see here
		return;
	}

	m_fTargetRange = fDistAway;

	//if its a body's hitbox, check the body instead
	CBodyFX* pBody = g_pGameClientShell->GetSFXMgr()->GetBodyFromHitBox(m_hTarget);
	if (pBody)
	{
		m_hTarget = pBody->GetServerObj();
		m_ActivationData.m_hTarget = m_hTarget;
		if (!m_hTarget) return;
	}

	//if its a Character's hitbox and it is searchable, check the Character instead
	CCharacterFX* pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFromHitBox(m_hTarget);
	if (pCharacter)
	{
		m_hTarget = pCharacter->GetServerObj();
		m_ActivationData.m_hTarget = m_hTarget;
		if (!m_hTarget) return;
	}



	uint32 dwUserFlags = 0;
    g_pCommonLT->GetObjectFlags(m_hTarget, OFT_User, dwUserFlags);

	// If we're on a vehicle (or if we are dead) all we care about is other players in a multiplayer game...
	// Some vehicles (like the PlayerLure) let you activate, so we'll just check if the
	// vehicle will let us show a crosshair to see if we're on a "true" vehicle or not...

	// It would be great if we didn't have to do all these checks, but such is life...

	bool bPlayersOnly = g_pPlayerMgr->IsPlayerDead() || (g_pPlayerMgr->GetMoveMgr()->GetVehicleMgr()->CanShowCrosshair() ? false : true);


	if (!bPlayersOnly)
	{
		//special case handling for bodies
		if (pBody || pCharacter)
		{
			bool bCanSearch = !!(dwUserFlags & USRFLG_CAN_SEARCH);
			if (pBody)
			{
				if (fDistAway <= g_vtActivationDistance.GetFloat())
				{
					// Make target glow, so it stands out more...
					g_pCommonLT->SetObjectFlags(m_hTarget, OFT_User, USRFLG_GLOW, USRFLG_GLOW);
				}
				
				if (pBody->CanBeRevived() && fDistAway <= g_vtReviveDistance.GetFloat() && IsRevivePlayerGameType( ))
				{
					// Get the client information of the body and us.
					uint32 nId = pBody->GetClientId();
					CClientInfoMgr* pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
					CLIENT_INFO* pCI = pCIMgr->GetClientByID(nId);
					CLIENT_INFO *pLocalCI = g_pInterfaceMgr->GetClientInfoMgr()->GetLocalClient();

					// Only allow us to revive people on the same team.  For non-team games,
					// the teamid will be set to the same invalid value anyway.
					if( pCI && pLocalCI )
					{
						if (pCI->nTeamID == pLocalCI->nTeamID)
						{
							m_nString = 0;
							FormatString(IDS_TARGET_REVIVE, m_szString, ARRAY_LEN(m_szString), pCI->sName.c_str());

							LTVector vObjPos, vDims;
							g_pLTClient->GetObjectPos(pBody->GetServerObj(), &vObjPos);
							g_pPhysicsLT->GetObjectDims(pBody->GetServerObj(), &vDims);

							// Players are non-solid to each other so you can revive right on top of them.
							m_bCanActivate = true;  //!CheckForCharacters(vObjPos, vDims, pBody->GetClientId());
							m_bMoveTarget = true;
							m_ActivationData.m_nType = MID_ACTIVATE_REVIVE;
						}
						else
						{
							m_nString = 0;
							m_bCanActivate = false;
							m_bMoveTarget = false;
							LTStrCpy(m_szString, pCI->sName.c_str(), ARRAY_LEN(m_szString));

						}

						return;
					}

				}
				else
				{
					m_bMoveTarget = (pBody->CanBeCarried() && g_pPlayerMgr->CanDropCarriedObject());
				}

			}
			else if (pCharacter)
			{
				if( (pCharacter->m_cs.eCrosshairCharacterClass != BAD) && (pCharacter->CanWake()) && (pCharacter->IsUnconscious() || (pCharacter->Slipped() && !pCharacter->m_cs.bIsPlayer)) ) 
				{
					SetTargetStringID( IDS_TARGET_WAKEUP );
					
					m_bCanActivate	= true;
					m_bMoveTarget	= g_pPlayerMgr->CanDropCarriedObject() && pCharacter->CanBeCarried();

					m_ActivationData.m_nType = MID_ACTIVATE_WAKEUP;
					return;
				}

				m_bMoveTarget = g_pPlayerMgr->CanDropCarriedObject() && pCharacter->CanBeCarried();
			}
			else
			{
				m_bMoveTarget = false;
			}

			if (bCanSearch && fDistAway <= g_vtActivationDistance.GetFloat())
			{
				// we can search this body
				m_bSearchTarget = true;
				m_ActivationData.m_nType = MID_ACTIVATE_SEARCH;
				SetTargetStringID(IDS_TARGET_SEARCH);

				uint8 nProgress = g_pPlayerMgr->GetSearcher()->GetMaxProgress();
				g_pPlayerStats->UpdateMaxProgress( nProgress );
				g_pPlayerStats->UpdateProgress( nProgress );
				g_pHUDMgr->QueueUpdate( kHUDProgressBar );

				return;
			}
			else if (pBody)
			{
				return;
			}

		}
		else
		{
			float fGadgetDistance = g_vtActivationDistance.GetFloat();
			if( dwUserFlags & USRFLG_GADGET_CAMERA )
			{
				fGadgetDistance = g_vtCamZoom1MaxDist.GetFloat();
			}

			// is this a gadget target
			if (IsGadgetActivatable(m_hTarget) && (fDistAway <= fGadgetDistance))
			{
				// looks like we can use a gadget on it...
				SetGadgetTarget( false );
				return;
			}
		}
	}

	//are we aiming at a person?
	if (dwUserFlags & USRFLG_CHARACTER)
	{
		CCharacterFX* const pFX = (CCharacterFX*)g_pGameClientShell->GetSFXMgr()->FindSpecialFX(SFX_CHARACTER_ID, m_hTarget);

		// All we care about if we're on a vehicle (or if we are dead) is the Multiplayer check below...

		if (!bPlayersOnly)
		{
			//display debug info if we have any 
			if( pFX && pFX->GetInfoString() && *pFX->GetInfoString() )
			{
				SAFE_STRCPY(m_szDebugString,pFX->GetInfoString());			
			}
			else
			{
				m_szDebugString[0] = NULL;
			}

			// is this a person we can talk to?
			if (dwUserFlags & USRFLG_CAN_ACTIVATE)
			{
				if (fDistAway <= g_vtActivationDistance.GetFloat())
				{
					SetTargetStringID(IDS_TARGET_TALK);
					return;
				}
			}
		}

		// This is the only thing we care about if we're dead or on a vehicle...(we care
		// if we're off a vehicle too)

		if (IsMultiplayerGame() && pFX && pFX->m_cs.bIsPlayer )
		{
			uint32 nId = pFX->m_cs.nClientID;
			CClientInfoMgr* pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
			CLIENT_INFO* pCI = pCIMgr->GetClientByID(nId);

			if (pCI)
			{
				m_nString = 0;
				SAFE_STRCPY(m_szString,pCI->sName.c_str());

				if (IsTeamGameType())
				{
					m_nTargetTeam = pCI->nTeamID;
				}
			}
			return;
		}
	
		// All we care about if we're dead or on a vehicle is the Multiplayer check above...

		if (!bPlayersOnly)
		{
			if( (fDistAway <= g_vtTargetDistance.GetFloat()) && pFX )
			{
				// If a nameid was specified for the model display the name...

				uint16 nNameId = g_pModelButeMgr->GetModelNameId( pFX->m_cs.eModelId );
				if( nNameId != (uint16)-1 )
				{
					if( nNameId > 0 )
					{
						SetTargetStringID( nNameId );
						return;
					}

					// warn the player if we are pointing at a friend...
					if( pFX->m_cs.eCrosshairCharacterClass != BAD )
					{
						SetTargetStringID( IDS_TARGET_INNOCENT );
						return;
					}
				}
			}
		}
	}

	// All we care about if we're dead or on a vehicle is the above Multiplayer check...
	if (bPlayersOnly)
	{
		// Didn't see another player in Multiplayer, so we have no target...
		ClearTargetInfo();
		return;
	}


	//is this a searchable object?
	if (dwUserFlags & USRFLG_CAN_SEARCH && (fDistAway <= g_vtActivationDistance.GetFloat()))
	{
		m_bSearchTarget = true;
		m_ActivationData.m_nType = MID_ACTIVATE_SEARCH;
		SetTargetStringID(IDS_TARGET_SEARCH);
		
		uint8 nProgress = g_pPlayerMgr->GetSearcher()->GetMaxProgress();
		g_pPlayerStats->UpdateMaxProgress( nProgress );
		g_pPlayerStats->UpdateProgress( nProgress );
		g_pHUDMgr->QueueUpdate( kHUDProgressBar );

		return;

	}
	
	// See if this object is part of the activate object list with it's own string ID's...

	if( fDistAway <= g_vtActivationDistance.GetFloat() )
	{
		CActivateObjectHandler *pActivateObj = LTNULL;
		CActivateObjectHandler::ActivateObjList::const_iterator iter = CActivateObjectHandler::GetActivateObjectList().begin();
		while( iter != CActivateObjectHandler::GetActivateObjectList().end() )
		{
			pActivateObj = *iter;
			
			if( pActivateObj->GetHOBJECT() == m_hTarget )
			{
				ACTIVATETYPE *pType = g_pActivateTypeMgr->GetActivateType( pActivateObj->m_nId );
				if( pType )
				{
					// Set whether or not it's disabled and set the string based on the state...

					m_bCanActivate = !pActivateObj->m_bDisabled;
					uint32 dwStringID = pType->dwStateID[pActivateObj->m_eState];
					
					if( dwStringID != (uint32)-1 )
					{
						SetTargetStringID( dwStringID );
					}

					return;
				}
			}

			++iter;
		}
	}

	//can we pick up or activate it?
	if (dwUserFlags & USRFLG_CAN_ACTIVATE && (fDistAway <= g_vtActivationDistance.GetFloat()))
	{
		//special case for bombs to defuse
		CGadgetTargetFX* const pGTFX = (CGadgetTargetFX*)g_pGameClientShell->GetSFXMgr()->FindSpecialFX(SFX_GADGETTARGET_ID, m_hTarget);
		if (pGTFX)
		{
			GadgetTargetType eGadgetType = pGTFX->GetType();
			if (eBombable == eGadgetType)
			{
				// Can only defuse a bomb that doesn't belong to your team...
				
				if( IsTeamGameType() )
				{
					CLIENT_INFO *pLocalCI = g_pInterfaceMgr->GetClientInfoMgr()->GetLocalClient();
					if( !pLocalCI )
						return;

					if( pGTFX->GetTeamID() != INVALID_TEAM )
					{
						if( pLocalCI->nTeamID == pGTFX->GetTeamID() )
						{
							m_bCanActivate = false;
						}
					}
				}

				SetTargetStringID(IDS_TARGET_DEFUSE);
				return;
			}
		}

		CPickupItemFX* const pFX = (CPickupItemFX*)g_pGameClientShell->GetSFXMgr()->FindSpecialFX(SFX_PICKUPITEM_ID, m_hTarget);

		// If this is a pickupitem, then display any team association it has.
		if( IsTeamGameType() && pFX )
		{
			m_nTargetTeam = pFX->GetTeamId( );
		}
		
		// If we're looking at a pickup, use the take string, otherwise it's just something to interact with.
		SetTargetStringID(pFX ? IDS_TARGET_TAKE : IDS_TARGET_USE);
		return;
	}

	// Are we looking at a doomsday piece...
	
	CDoomsdayPieceFX *pDDPiece = dynamic_cast<CDoomsdayPieceFX*>(g_pGameClientShell->GetSFXMgr()->FindSpecialFX( SFX_DOOMSDAYPIECE_ID, m_hTarget ));
	if( pDDPiece && (fDistAway <= g_vtActivationDistance.GetFloat()) )
	{
		m_bCanActivate = false;
		m_bMoveTarget = true;
	}
}
Ejemplo n.º 3
0
static void WalkDirtyRegions( TESStesselator *tess, ActiveRegion *regUp )
/*
* When the upper or lower edge of any region changes, the region is
* marked "dirty".  This routine walks through all the dirty regions
* and makes sure that the dictionary invariants are satisfied
* (see the comments at the beginning of this file).  Of course
* new dirty regions can be created as we make changes to restore
* the invariants.
*/
{
	ActiveRegion *regLo = RegionBelow(regUp);
	TESShalfEdge *eUp, *eLo;

	for( ;; ) {
		/* Find the lowest dirty region (we walk from the bottom up). */
		while( regLo->dirty ) {
			regUp = regLo;
			regLo = RegionBelow(regLo);
		}
		if( ! regUp->dirty ) {
			regLo = regUp;
			regUp = RegionAbove( regUp );
			if( regUp == NULL || ! regUp->dirty ) {
				/* We've walked all the dirty regions */
				return;
			}
		}
		regUp->dirty = FALSE;
		eUp = regUp->eUp;
		eLo = regLo->eUp;

		if( eUp->Dst != eLo->Dst ) {
			/* Check that the edge ordering is obeyed at the Dst vertices. */
			if( CheckForLeftSplice( tess, regUp )) {

				/* If the upper or lower edge was marked fixUpperEdge, then
				* we no longer need it (since these edges are needed only for
				* vertices which otherwise have no right-going edges).
				*/
				if( regLo->fixUpperEdge ) {
					DeleteRegion( tess, regLo );
					if ( !tessMeshDelete( tess->mesh, eLo ) ) longjmp(tess->env,1);
					regLo = RegionBelow( regUp );
					eLo = regLo->eUp;
				} else if( regUp->fixUpperEdge ) {
					DeleteRegion( tess, regUp );
					if ( !tessMeshDelete( tess->mesh, eUp ) ) longjmp(tess->env,1);
					regUp = RegionAbove( regLo );
					eUp = regUp->eUp;
				}
			}
		}
		if( eUp->Org != eLo->Org ) {
			if(    eUp->Dst != eLo->Dst
				&& ! regUp->fixUpperEdge && ! regLo->fixUpperEdge
				&& (eUp->Dst == tess->event || eLo->Dst == tess->event) )
			{
				/* When all else fails in CheckForIntersect(), it uses tess->event
				* as the intersection location.  To make this possible, it requires
				* that tess->event lie between the upper and lower edges, and also
				* that neither of these is marked fixUpperEdge (since in the worst
				* case it might splice one of these edges into tess->event, and
				* violate the invariant that fixable edges are the only right-going
				* edge from their associated vertex).
				*/
				if( CheckForIntersect( tess, regUp )) {
					/* WalkDirtyRegions() was called recursively; we're done */
					return;
				}
			} else {
				/* Even though we can't use CheckForIntersect(), the Org vertices
				* may violate the dictionary edge ordering.  Check and correct this.
				*/
				(void) CheckForRightSplice( tess, regUp );
			}
		}
		if( eUp->Org == eLo->Org && eUp->Dst == eLo->Dst ) {
			/* A degenerate loop consisting of only two edges -- delete it. */
			AddWinding( eLo, eUp );
			DeleteRegion( tess, regUp );
			if ( !tessMeshDelete( tess->mesh, eUp ) ) longjmp(tess->env,1);
			regUp = RegionAbove( regLo );
		}
	}
}
Ejemplo n.º 4
0
void CTargetMgr::Update()
{
	// Do any necessary initialization...

	if (m_bFirstUpdate)
	{
		FirstUpdate();
		m_bFirstUpdate = false;
	}

	g_pPlayerStats->UpdateMaxProgress( 0 );
	g_pPlayerStats->UpdateProgress( 0 );

	// Start fresh
	ClearTargetInfo();

	//see what we've looking at
	float fDistAway = kMaxDistance;
	CheckForIntersect(fDistAway);
	m_fTargetRange = fDistAway;

	if (!m_hTarget) 
	{
		//nothing to see here
		SpecialMoveMgr::Instance().HandleLookedAt(NULL);
		return;
	}

	// If its a Character's hitbox, check the Character instead...
	CCharacterFX* pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFromHitBox(m_hTarget);
	if (pCharacter)
	{
		m_hTarget = pCharacter->GetServerObj();
		m_ActivationData.m_hTarget = m_hTarget;
		if (!m_hTarget) return;
	}

	CLadderFX *pLadder = g_pGameClientShell->GetSFXMgr()->GetLadderFX(m_hTarget);
	if (pLadder && LadderMgr::Instance().CanReachLadder(pLadder))
	{
		m_ActivationData.m_hTarget = m_hTarget;
		m_ActivationData.m_nType = MID_ACTIVATE_LADDER;
		return;
	}

	CTurretFX *pTurret = g_pGameClientShell->GetSFXMgr( )->GetTurretFX( m_hTarget );
	if( pTurret && pTurret->CanActivate( ))
	{
		m_ActivationData.m_hTarget = m_hTarget;
		m_ActivationData.m_nType = MID_ACTIVATE_TURRET;
		return;
	}

	CSpecialMoveFX *pSpecialMove = g_pGameClientShell->GetSFXMgr()->GetSpecialMoveFX(m_hTarget);
	if (pSpecialMove)
	{
		SpecialMoveMgr::Instance().HandleLookedAt(pSpecialMove);
		if (SpecialMoveMgr::Instance().CanReach(pSpecialMove))
		{
			m_ActivationData.m_hTarget = m_hTarget;
			m_ActivationData.m_nType = MID_ACTIVATE_SPECIALMOVE;
			return;
		}
	}
	else
	{
		SpecialMoveMgr::Instance().HandleLookedAt(NULL);
	}

	if( m_ActivationData.m_hActivateSnd )
	{
		m_ActivationData.m_nType = MID_ACTIVATE_SURFACESND;
	}

	CClientWeapon* pCurrentWeapon = g_pPlayerMgr->GetClientWeaponMgr()->GetCurrentClientWeapon();

	uint32 dwUserFlags = 0;
	g_pCommonLT->GetObjectFlags(m_hTarget, OFT_User, dwUserFlags);

	// is this a person we can talk to?
	if(( !(dwUserFlags & USRFLG_CAN_ACTIVATE) && m_ActivationData.m_nType != MID_ACTIVATE_SURFACESND ) || (fDistAway > g_vtActivationDistance.GetFloat()) )
	{
		m_ActivationData.m_hTarget = NULL;
	}


	// If we're on a vehicle (or if we are dead) all we care about is other players in a multiplayer game...
	// Some vehicles (like the PlayerLure) let you activate, so we'll just check if the
	// vehicle will let us show a crosshair to see if we're on a "true" vehicle or not...

	// It would be great if we didn't have to do all these checks, but such is life...

	bool bPlayersOnly = !g_pPlayerMgr->IsPlayerAlive() || (g_pPlayerMgr->GetMoveMgr()->GetVehicleMgr()->CanShowCrosshair() ? false : true);

	//are we aiming at a person?
	if (dwUserFlags & USRFLG_CHARACTER)
	{
		CCharacterFX* const pFX = (CCharacterFX*)g_pGameClientShell->GetSFXMgr()->FindSpecialFX(SFX_CHARACTER_ID, m_hTarget);

		// All we care about if we're on a vehicle (or if we are dead) is the Multiplayer check below...

		if (!bPlayersOnly)
		{
			//display debug info if we have any 
			if( pFX && pFX->GetInfoString() && *pFX->GetInfoString() )
			{
				g_pHUDDebug->SetTargetDebugString(pFX->GetInfoString());
			}
			else
			{
				g_pHUDDebug->SetTargetDebugString(L"");
			}

			// is this a person we can talk to?
			if (dwUserFlags & USRFLG_CAN_ACTIVATE)
			{
				if (fDistAway <= g_vtActivationDistance.GetFloat())
				{
					// SetTargetStringID(IDS_TARGET_TALK);
					return;
				}
			}
		}

		// This is the only thing we care about if we're dead or on a vehicle...(we care
		// if we're off a vehicle too)

		if (IsMultiplayerGameClient() && pFX && pFX->m_cs.bIsPlayer )
		{
			uint32 nId = pFX->m_cs.nClientID;
			CClientInfoMgr* pCIMgr = g_pInterfaceMgr->GetClientInfoMgr();
			CLIENT_INFO* pCI = pCIMgr->GetClientByID(nId);

			if (pCI)
			{
				m_szStringID = NULL;
				LTStrCpy(m_wszString, pCI->sName.c_str(), LTARRAYSIZE(m_wszString));

				if (GameModeMgr::Instance( ).m_grbUseTeams)
				{
					m_nTargetTeam = pCI->nTeamID;
				}
			}
			return;
		}

		// All we care about if we're dead or on a vehicle is the Multiplayer check above...

		if (!bPlayersOnly)
		{
			if(pFX)
			{
				if (fDistAway <= g_vtTargetDistance.GetFloat()) 
				{
					// If a nameid was specified for the model display the name...
					const char* szNameId = g_pModelsDB->GetModelNameId( pFX->m_cs.hModel );
					if( szNameId && (szNameId[0] != '\0') )
					{
						//SetTargetStringID( nNameId );
						return;
					}
				}
			}
		}
	}

	// See if this object is part of the activate object list with it's own string ID's...
	if( fDistAway <= g_vtActivationDistance.GetFloat() )
	{
		const CActivateObjectHandler *pActivateObj = CActivateObjectHandler::FindActivateObject( m_hTarget );
		if( pActivateObj )
		{
			// See whether or not it's disabled
			m_bCanActivate = !pActivateObj->m_bDisabled;

			// Fetch the proper string from the database depending on the state...
			HRECORD hRecord = DATABASE_CATEGORY( Activate ).GetRecordByIndex( pActivateObj->m_nId );
			HATTRIBUTE hStates = DATABASE_CATEGORY( Activate ).GETRECORDSTRUCT( hRecord, States );
			const char* pszStringID = DATABASE_CATEGORY( Activate ).GETSTRUCTATTRIB( States, hStates, pActivateObj->m_eState, HudText );
			if( !LTStrEmpty( pszStringID ) )
			{
				SetTargetStringID( pszStringID );
			}
			return;
		}
	}


	// All we care about if we're dead or on a vehicle is the above Multiplayer check...
	if (bPlayersOnly)
	{
		// Didn't see another player in Multiplayer, so we have no target...
		ClearTargetInfo();
		return;
	}

}