From d3ed5ad44f2c2d2cd3ffc1de254c2ddac9690bf0 Mon Sep 17 00:00:00 2001
From: Jaime Passos <lazymyuutsu@gmail.com>
Date: Fri, 28 Feb 2020 23:47:38 -0300
Subject: [PATCH] Race is Competition without the lives

---
 src/d_netcmd.c | 4 ++--
 src/p_setup.c  | 2 +-
 src/p_spec.c   | 4 ++--
 src/st_stuff.c | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index a77ea0dd50..60f03f137a 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -3629,7 +3629,7 @@ static void PointLimit_OnChange(void)
 static void NumLaps_OnChange(void)
 {
 	// Just don't be verbose
-	if (gametype == GT_RACE)
+	if ((gametyperules & (GTR_RACE|GTR_LIVES)) == GTR_RACE)
 		CONS_Printf(M_GetText("Number of laps set to %d\n"), cv_numlaps.value);
 }
 
@@ -4608,7 +4608,7 @@ static void Command_ShowTime_f(void)
 
 static void BaseNumLaps_OnChange(void)
 {
-	if (gametype == GT_RACE)
+	if ((gametyperules & (GTR_RACE|GTR_LIVES)) == GTR_RACE)
 	{
 		if (cv_basenumlaps.value)
 			CONS_Printf(M_GetText("Number of laps will be changed to map defaults next round.\n"));
diff --git a/src/p_setup.c b/src/p_setup.c
index 7b4c6773b0..1bb67c9b8e 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -3374,7 +3374,7 @@ static void P_InitGametype(void)
 
 	if (G_TagGametype())
 		P_InitTagGametype();
-	else if (gametype == GT_RACE && server)
+	else if (((gametyperules & (GTR_RACE|GTR_LIVES)) == GTR_RACE) && server)
 		CV_StealthSetValue(&cv_numlaps,
 		(cv_basenumlaps.value)
 			? cv_basenumlaps.value
diff --git a/src/p_spec.c b/src/p_spec.c
index d9bbab246e..15c88927ee 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -4991,7 +4991,7 @@ DoneSection2:
 			break;
 
 		case 10: // Finish Line
-			if (gametype == GT_RACE && !player->exiting)
+			if (((gametyperules & (GTR_RACE|GTR_LIVES)) == GTR_RACE) && !player->exiting)
 			{
 				if (player->starpostnum == numstarposts) // Must have touched all the starposts
 				{
@@ -6483,7 +6483,7 @@ void P_SpawnSpecials(boolean fromnetsave)
 		switch(GETSECSPECIAL(sector->special, 4))
 		{
 			case 10: // Circuit finish line
-				if (gametype == GT_RACE)
+				if ((gametyperules & (GTR_RACE|GTR_LIVES)) == GTR_RACE)
 					circuitmap = true;
 				break;
 		}
diff --git a/src/st_stuff.c b/src/st_stuff.c
index cb5c0fbc11..6bc5b452c2 100644
--- a/src/st_stuff.c
+++ b/src/st_stuff.c
@@ -2688,7 +2688,7 @@ static void ST_overlayDrawer(void)
 		&& (netgame || multiplayer)
 		&& (cv_cooplives.value == 0))
 	;
-	else if ((G_GametypeUsesLives() || gametype == GT_RACE) && stplyr->lives <= 0 && !(hu_showscores && (netgame || multiplayer)))
+	else if ((G_GametypeUsesLives() || ((gametyperules & (GTR_RACE|GTR_LIVES)) == GTR_RACE)) && stplyr->lives <= 0 && !(hu_showscores && (netgame || multiplayer)))
 	{
 		INT32 i = MAXPLAYERS;
 		INT32 deadtimer = stplyr->spectator ? TICRATE : (stplyr->deadtimer-(TICRATE<<1));
-- 
GitLab