Пример #1
0
static bool NonSolidFilterFn(HOBJECT hTest, void *pUserData)
{
	if (ObjListFilterFn(hTest, pUserData))
	{
		// Ignore non-solid objects (even if ray-hit is true)...

		uint32 dwFlags;
		g_pCommonLT->GetObjectFlags(hTest, OFT_Flags, dwFlags);

		if (!(dwFlags & FLAG_SOLID))
		{
			return false;
		}
	}
    return true;
}
Пример #2
0
static bool AutoTargetFilterFn(HOBJECT hTest, void *pUserData)
{
	// Ignore objects that are invisible
	uint32 dwFlags;
	g_pCommonLT->GetObjectFlags(hTest, OFT_Flags, dwFlags);

	if (!(dwFlags & FLAG_VISIBLE))
	{
		return false;
	}
	
	if(!(dwFlags & FLAG_RAYHIT))
	{
		return false;
	}

	HOBJECT hClientHitBox = NULL;
	CCharacterFX* pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFX(g_pLTClient->GetClientObject());
	if (pCharacter) 
	{
		hClientHitBox = pCharacter->GetHitBox();
	}

	
	// Okay, do normal tests...
	HOBJECT hFilterList[] = 
	{
		g_pLTClient->GetClientObject(),
		g_pPlayerMgr->GetMoveMgr()->GetObject(),
		hClientHitBox,
		NULL
	};

	if (!ObjListFilterFn(hTest, (void*) hFilterList))
	{
		return false;
	}



    return true;
}
Пример #3
0
static bool ActivateFilterFn(HOBJECT hTest, void *pUserData)
{
	// [KLS 6/26/02] - Make sure we filter out client related objects first...

	HOBJECT hClientHitBox = LTNULL;
	CCharacterFX* pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFX(g_pLTClient->GetClientObject());
	if (pCharacter) 
	{
		hClientHitBox = pCharacter->GetHitBox();
	}

	HOBJECT hFilterList[] = 
	{
		g_pLTClient->GetClientObject(),
		g_pPlayerMgr->GetMoveMgr()->GetObject(),
		hClientHitBox,
		LTNULL
	};
	if (!ObjListFilterFn(hTest, (void*) hFilterList))
	{
		return false;
	}

	// Always keep gadget targets...
	if (g_pPlayerMgr->GetTargetMgr()->IsGadgetActivatable(hTest)) 
	{
		return true;
	}

	// Always keep our locked target...
	if (g_pPlayerMgr->GetTargetMgr()->GetLockedTarget() == hTest) 
	{
		return true;
	}

	// Look to see if it is a DoomsDayPiece.  This should take precedence over characters and bodies...

	CDoomsdayPieceFX *pDDPiece = dynamic_cast<CDoomsdayPieceFX*>(g_pGameClientShell->GetSFXMgr()->FindSpecialFX( SFX_DOOMSDAYPIECE_ID, hTest ));
	if( pDDPiece )
	{
		// If the piece is planted on our teams bse we no longer care about it...

		if( pDDPiece->IsPlanted() && (pDDPiece->GetTeam() != INVALID_TEAM) )
		{
			CLIENT_INFO *pLocalCI = g_pInterfaceMgr->GetClientInfoMgr()->GetLocalClient();
			if( !pLocalCI )
				return false;

			if( pLocalCI->nTeamID == pDDPiece->GetTeam() )
			{
				return false;
			}
		}

		return true;
	}
	

	// If it's a body, ignore it (we only care about its hit box)
	CBodyFX* pBody = g_pGameClientShell->GetSFXMgr()->GetBodyFX(hTest);
	if (pBody) 
	{
		return false;
	}

	// If it's a hitbox associated with a body we care.
	pBody = g_pGameClientShell->GetSFXMgr()->GetBodyFromHitBox(hTest);
	if (pBody)
	{
		// Save body for later since it may overlap a higher priority object
		SetFallbackActivationObject(hTest, (IntersectQuery*)pUserData);
		return false;
	}

	// If it's a Character and it has a hitbox, ignore it (we only care about its hit box)
	pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFX(hTest);
	if (pCharacter) 
	{
		if (pCharacter->GetHitBox())
		{
			return false;
		}

		// Save character for later if unconscious since it may overlap a 
		// higher priority object
		if (pCharacter->IsUnconscious())
		{
			SetFallbackActivationObject(hTest, (IntersectQuery*)pUserData);
			return false;
		}

		return true; // "Solid" object so we're done
	}

	// If it's a hitbox associated with a Character we care about it...
	pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFromHitBox(hTest);
	if (pCharacter)
	{
		if (pCharacter->IsUnconscious())
		{
			// Save character for later since it may overlap a higher priority object
			SetFallbackActivationObject(hTest, (IntersectQuery*)pUserData);
			return false;
		}

		return true; // "Solid" object so we're done
	}

 	// Ignore non-solid objects that can't be activated...

	uint32 dwFlags;
	g_pCommonLT->GetObjectFlags(hTest, OFT_Flags, dwFlags);

	if (!(dwFlags & FLAG_SOLID))
	{
		// This object is most likely a pickup of some type and it should
		// take priority over all the above objects types...however, since all
		// we can test are its flags we have to filter out the above objects
		// first (instead of testing for this type of object at the top of 
		// the function ;)

		return IsUserFlagSet(hTest, (USRFLG_CAN_ACTIVATE | USRFLG_CAN_SEARCH));
	}

	// Hit something solid, so we're done...
    return true;
}
Пример #4
0
static bool ActivateFilterFn(HOBJECT hTest, void *pUserData)
{
	// [KLS 6/26/02] - Make sure we filter out client related objects first...

	HOBJECT hClientHitBox = NULL;
	CCharacterFX* pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFX(g_pLTClient->GetClientObject());
	if (pCharacter) 
	{
		hClientHitBox = pCharacter->GetHitBox();
	}

	HOBJECT hFilterList[] = 
	{
		g_pLTClient->GetClientObject(),
		g_pPlayerMgr->GetMoveMgr()->GetObject(),
		hClientHitBox,
		NULL
	};
	if (!ObjListFilterFn(hTest, (void*) hFilterList))
	{
		return false;
	}

	// Always keep our locked target...
	if (g_pPlayerMgr->GetTargetMgr()->GetLockedTarget() == hTest) 
	{
		return true;
	}

	// If it's a Character and it has a hitbox, ignore it (we only care about its hit box)
	pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFX(hTest);
	if (pCharacter) 
	{
		if (pCharacter->GetHitBox())
		{
			return false;
		}
/*
		// Save character for later if unconscious since it may overlap a 
		// higher priority object
		if (pCharacter->IsUnconscious())
		{
			SetFallbackActivationObject(hTest, (IntersectQuery*)pUserData);
			return false;
		}
*/
		return true; // "Solid" object so we're done
	}

	// If it's a hitbox associated with a Character we care about it...
	pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFromHitBox(hTest);
	if (pCharacter)
	{
/*
		if (pCharacter->IsUnconscious())
		{
			// Save character for later since it may overlap a higher priority object
			SetFallbackActivationObject(hTest, (IntersectQuery*)pUserData);
			return false;
		}
*/
		return true; // "Solid" object so we're done
	}

	CLadderFX *pLadder = g_pGameClientShell->GetSFXMgr()->GetLadderFX(hTest);
	if (pLadder)
	{
		return true;
	}

	CTurretFX *pTurret = g_pGameClientShell->GetSFXMgr( )->GetTurretFX( hTest );
	if( pTurret )
	{
		return true;
	}

	CSpecialMoveFX *pSpecialMove = g_pGameClientShell->GetSFXMgr()->GetSpecialMoveFX(hTest);
	if (pSpecialMove)
	{
		return true;
	}


 	// Ignore non-solid objects that can't be activated...

	uint32 dwFlags;
	g_pCommonLT->GetObjectFlags(hTest, OFT_Flags, dwFlags);

	if (!(dwFlags & FLAG_SOLID))
	{
		// This object is most likely a pickup of some type and it should
		// take priority over all the above objects types...however, since all
		// we can test are its flags we have to filter out the above objects
		// first (instead of testing for this type of object at the top of 
		// the function ;)

		return IsUserFlagSet(hTest, USRFLG_CAN_ACTIVATE );
	}

	// Hit something solid, so we're done...
    return true;
}