mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-20 08:20:52 +00:00
add G_CompetitionGametype(void)
This commit is contained in:
parent
5c023739e6
commit
f8eed7171a
4 changed files with 13 additions and 2 deletions
10
src/g_game.c
10
src/g_game.c
|
@ -3492,6 +3492,16 @@ boolean G_TagGametype(void)
|
|||
return (gametyperules & GTR_TAG);
|
||||
}
|
||||
|
||||
//
|
||||
// G_CompetitionGametype
|
||||
//
|
||||
// For gametypes that are race gametypes, and have lives.
|
||||
//
|
||||
boolean G_CompetitionGametype(void)
|
||||
{
|
||||
return ((gametyperules & GTR_RACE) && (gametyperules & GTR_LIVES));
|
||||
}
|
||||
|
||||
/** Get the typeoflevel flag needed to indicate support of a gametype.
|
||||
* In single-player, this always returns TOL_SP.
|
||||
* \param gametype The gametype for which support is desired.
|
||||
|
|
|
@ -223,6 +223,7 @@ boolean G_GametypeHasSpectators(void);
|
|||
boolean G_RingSlingerGametype(void);
|
||||
boolean G_PlatformGametype(void);
|
||||
boolean G_TagGametype(void);
|
||||
boolean G_CompetitionGametype(void);
|
||||
boolean G_EnoughPlayersFinished(void);
|
||||
void G_ExitLevel(void);
|
||||
void G_NextLevel(void);
|
||||
|
|
|
@ -2159,7 +2159,7 @@ static void P_LevelInitStuff(void)
|
|||
{
|
||||
G_PlayerReborn(i, true);
|
||||
|
||||
if (canresetlives && (netgame || multiplayer) && playeringame[i] && (gametype == GT_COMPETITION || players[i].lives <= 0))
|
||||
if (canresetlives && (netgame || multiplayer) && playeringame[i] && (G_CompetitionGametype() || players[i].lives <= 0))
|
||||
{
|
||||
// In Co-Op, replenish a user's lives if they are depleted.
|
||||
players[i].lives = cv_startinglives.value;
|
||||
|
|
|
@ -9491,7 +9491,7 @@ static void P_DeathThink(player_t *player)
|
|||
INT32 i, deadtimercheck = INT32_MAX;
|
||||
|
||||
// In a net/multiplayer game, and out of lives
|
||||
if (gametype == GT_COMPETITION)
|
||||
if (G_CompetitionGametype())
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue