Ejemplo n.º 1
0
/**
 * @brief Check if the edict appears/perishes for the other teams. If they appear
 * for other teams, the needed information for those clients are also send in
 * @c G_CheckVisTeam resp. @c G_AppearPerishEvent
 * @param[in] check The edict that is maybe seen by others. If nullptr, all edicts are checked
 * @param visFlags Modifiers for the checks
 * @sa G_CheckVisTeam
 */
void G_CheckVis (Edict* check, const vischeckflags_t visFlags)
{
	for (int team = 0; team < MAX_TEAMS; team++)
		if (level.num_alive[team]) {
			if (!check)	/* no special entity given, so check them all */
				G_CheckVisTeamAll(team, visFlags, nullptr);
			else
				G_CheckVisTeam(team, check, visFlags, nullptr);
		}
}
Ejemplo n.º 2
0
/**
 * @brief Do @c G_CheckVisTeam for all entities
 */
int G_CheckVisTeamAll (const int team, bool perish, const edict_t *ent)
{
	edict_t *chk = NULL;
	int status = 0;

	while ((chk = G_EdictsGetNextInUse(chk))) {
		status |= G_CheckVisTeam(team, chk, perish, ent);
	}
	return status;
}
Ejemplo n.º 3
0
/**
 * @brief Do @c G_CheckVisTeam for all entities
 * ent is the one that is looking at the others
 */
int G_CheckVisTeamAll (const int team, const vischeckflags_t visFlags, const Edict* ent)
{
	Edict* chk = nullptr;
	int status = 0;

	while ((chk = G_EdictsGetNextInUse(chk))) {
		status |= G_CheckVisTeam(team, chk, visFlags, ent);
	}
	return status;
}
Ejemplo n.º 4
0
/**
 * @brief Check if the edict appears/perishes for the other teams. If they appear
 * for other teams, the needed information for those clients are also send in
 * @c G_CheckVisTeam resp. @c G_AppearPerishEvent
 * @param[in] perish Also check for perishing events
 * @param[in] check The edict that is maybe seen by others. If NULL, all edicts are checked
 * @return Bitmask of VIS_* values
 * @sa G_CheckVisTeam
 */
int G_CheckVis (edict_t * check, bool perish)
{
	int team;
	int status;

	status = 0;
	for (team = 0; team < MAX_TEAMS; team++)
		if (level.num_alive[team]) {
			if (!check)	/* no special entity given, so check them all */
				status |= G_CheckVisTeamAll(team, perish, NULL);
			else
				status |= G_CheckVisTeam(team, check, perish, NULL);
		}

	return status;
}