UFO: Alien Invasion
Loading...
Searching...
No Matches
g_match.h File Reference

Match related functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void G_MatchEndTrigger (int team, int timeGap)
 Triggers the end of the game. Will be executed in the next server (or game) frame.
bool G_MatchDoEnd (void)
 Checks whether a match is over.
void G_MatchEndCheck (void)
 Checks whether there are still actors to fight with left. If none are the match end will be triggered.
bool G_MatchIsRunning (void)
 Checks whether the game is running (active team and no intermission time).

Detailed Description

Match related functions.

Definition in file g_match.h.

Function Documentation

◆ G_MatchDoEnd()

bool G_MatchDoEnd ( void )

Checks whether a match is over.

Returns
true if this match is over, false otherwise

Definition at line 253 of file g_match.cpp.

References AIL_Cleanup(), G_MatchSendResults(), G_PrintStats(), gi, and level.

Referenced by G_RunFrame().

◆ G_MatchEndCheck()

void G_MatchEndCheck ( void )

Checks whether there are still actors to fight with left. If none are the match end will be triggered.

See also
G_MatchEndTrigger
Todo
count from 0 to get the civilians for objectives
Todo
< 2 does not work when we count civilians

Definition at line 280 of file g_match.cpp.

References G_EdictsGetNextLivingActorOfTeam(), G_MatchEndTrigger(), i, Actor::isStunned(), level, MAX_TEAMS, and TEAM_ALIEN.

Referenced by G_BleedWounds(), G_ClientDisconnect(), G_ClientMove(), and G_ClientShoot().

◆ G_MatchEndTrigger()

void G_MatchEndTrigger ( int team,
int timeGap )

Triggers the end of the game. Will be executed in the next server (or game) frame.

Parameters
[in]teamThe winning team
[in]timeGapSecond to wait before really ending the game. Useful if you want to allow a last view on the scene

Definition at line 125 of file g_match.cpp.

References G_EdictsGetTriggerNextMaps(), Edict::getTeam(), level, Edict::nextthink, Edict::think, and Think_NextMapTrigger().

Referenced by G_ClientEndRound(), G_MatchEndCheck(), G_MissionThink(), SVCmd_Win_f(), and Touch_NextMapTrigger().

◆ G_MatchIsRunning()

bool G_MatchIsRunning ( void )

Checks whether the game is running (active team and no intermission time).

Returns
true if there is an active team for the current turn and the end of the game was not yet triggered
See also
G_MatchEndTrigger

Definition at line 320 of file g_match.cpp.

References level, and TEAM_NO_ACTIVE.

Referenced by Door_Use(), G_CheckForceEndRound(), G_ClientEndRound(), G_ClientUserinfoChanged(), G_GetStartingTeam(), G_MissionThink(), G_ReactionFireCanBeEnabled(), and G_RunFrame().