/** * @brief Sets visible edict on player spawn * @sa G_ClientStartMatch * @sa G_CheckVisTeam * @sa G_AppearPerishEvent */ void G_CheckVisPlayer (Player& player, const vischeckflags_t visFlags) { Edict* ent = nullptr; /* check visibility */ while ((ent = G_EdictsGetNextInUse(ent))) { /* check if he's visible */ G_DoTestVis(player.getTeam(), ent, visFlags, G_PlayerToPM(player), nullptr); } }
/** * @brief Checks whether an edict appear/perishes for a specific team - also * updates the visflags each edict carries * @sa G_TestVis * @param[in] team Team to check the vis for * @param[in] check The edict that you want to check (and which maybe will appear * or perish for the given team). If this is NULL every edict will be checked. * @param[in] perish Also check whether the edict (the actor) is going to become * invisible for the given team * @param[in] ent The edict that is (maybe) seeing other edicts * @return If an actor get visible who's no civilian VIS_STOP is added to the * bit mask, VIS_YES means, he is visible, VIS_CHANGE means that the actor * flipped its visibility (invisible to visible or vice versa), VIS_PERISH means * that the actor (the edict) is getting invisible for the queried team * @note the edict may not only be actors, but also items of course * @sa G_TeamToPM * @sa G_TestVis * @sa G_AppearPerishEvent * @sa G_CheckVisPlayer * @sa G_CheckVisTeamAll * @note If something appears, the needed information for those clients that are affected * are also send in @c G_AppearPerishEvent */ int G_CheckVisTeam (const int team, edict_t *check, bool perish, const edict_t *ent) { int status = 0; /* check visibility */ if (check->inuse) { /* check if he's visible */ status |= G_DoTestVis(team, check, perish, G_TeamToPM(team), ent); } return status; }
/** * @brief Checks whether an edict appear/perishes for a specific team - also * updates the visflags each edict carries * @sa G_TestVis * @param[in] team Team to check the vis for * @param[in] check The edict that you want to check (and which maybe will appear * or perish for the given team). If this is nullptr every edict will be checked. * @param visFlags Modifiers for the checks * @param[in] ent The edict that is (maybe) seeing other edicts * @return If an actor get visible who's no civilian VIS_STOP is added to the * bit mask, VIS_APPEAR means, that the actor is becoming visible for the queried * team, VIS_PERISH means that the actor (the edict) is getting invisible * @note the edict may not only be actors, but also items of course * @sa G_TeamToPM * @sa G_TestVis * @sa G_AppearPerishEvent * @sa G_CheckVisPlayer * @sa G_CheckVisTeamAll * @note If something appears, the needed information for those clients that are affected * are also send in @c G_AppearPerishEvent */ static int G_CheckVisTeam (const int team, Edict* check, const vischeckflags_t visFlags, const Edict* ent) { int status = 0; /* check visibility */ if (check->inuse) { /* check if he's visible */ status |= G_DoTestVis(team, check, visFlags, G_TeamToPM(team), ent); } return status; }
/** * @brief Sets visible edict on player spawn * @sa G_ClientStartMatch * @sa G_CheckVisTeam * @sa G_AppearPerishEvent */ int G_CheckVisPlayer (player_t* player, bool perish) { int status = 0; edict_t* ent = NULL; /* check visibility */ while ((ent = G_EdictsGetNextInUse(ent))) { /* check if he's visible */ status |= G_DoTestVis(player->pers.team, ent, perish, G_PlayerToPM(player), NULL); } return status; }