Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

checkclient

From Quake Wiki

entity checkclient()

Usage[edit]

When a monster is searching for a valid enemy, this function will handle grabbing a potential target. This uses the PVS to check visible players meaning an actual line of sight won't be guaranteed and should be tested against.

Warning: The function assumes that self is the current entity that's looking for a valid enemy.

Return[edit]

A potentially visible player.

Example[edit]

// This function tries to find a new enemy for the monster
void FindNewEnemy()
{
    entity newEnemy = checkclient();

    // Check to make sure it's a valid enemy
    if (!newEnemy || newEnemy == self.enemy)
        return;
    if (!visible(newEnemy))
        return;

    // ...
}