From 80861f134d2506c71c1274215b7b35088cd6c1a9 Mon Sep 17 00:00:00 2001
From: Mario <mario@smbclan.net>
Date: Thu, 3 Dec 2015 19:16:16 +1000
Subject: [PATCH] Fix race and CTS modicons panel

---
 qcsrc/client/hud/panel/modicons.qc             | 4 ++--
 qcsrc/server/mutators/mutator/gamemode_cts.qc  | 3 ++-
 qcsrc/server/mutators/mutator/gamemode_race.qc | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/qcsrc/client/hud/panel/modicons.qc b/qcsrc/client/hud/panel/modicons.qc
index 8fab80ed61..8e3166b6ad 100644
--- a/qcsrc/client/hud/panel/modicons.qc
+++ b/qcsrc/client/hud/panel/modicons.qc
@@ -489,7 +489,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
 	mod_active = 1; // race should never hide the mod icons panel
 	entity me;
 	me = playerslots[player_localnum];
-	float t, score;
+	float score;
 	float f; // yet another function has this
 	score = me.(scores[ps_primary]);
 
@@ -502,7 +502,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
 		rr = CTS_RECORD;
 	else
 		rr = RACE_RECORD;
-	t = stof(db_get(ClientProgsDB, strcat(shortmapname, rr, "time")));
+	float t = stof(db_get(ClientProgsDB, strcat(shortmapname, rr, "time")));
 
 	if(score && (score < t || !t)) {
 		db_put(ClientProgsDB, strcat(shortmapname, rr, "time"), ftos(score));
diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc
index 6d756fc679..e72d898ce0 100644
--- a/qcsrc/server/mutators/mutator/gamemode_cts.qc
+++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc
@@ -11,11 +11,12 @@ REGISTER_MUTATOR(cts, false)
 	{
 		if (time > 1) // game loads at time 1
 			error("This is a game type and it cannot be added at runtime.");
-		cts_Initialize();
 
 		g_race_qualifying = true;
 		independent_players = 1;
 		SetLimits(0, 0, 0, -1);
+
+		cts_Initialize();
 	}
 
 	MUTATOR_ONROLLBACK_OR_REMOVE
diff --git a/qcsrc/server/mutators/mutator/gamemode_race.qc b/qcsrc/server/mutators/mutator/gamemode_race.qc
index 5b67888485..b3075910cb 100644
--- a/qcsrc/server/mutators/mutator/gamemode_race.qc
+++ b/qcsrc/server/mutators/mutator/gamemode_race.qc
@@ -10,9 +10,9 @@ REGISTER_MUTATOR(rc, false)
 	{
 		if (time > 1) // game loads at time 1
 			error("This is a game type and it cannot be added at runtime.");
-		race_Initialize();
 
 		rc_SetLimits();
+		race_Initialize();
 	}
 
 	MUTATOR_ONROLLBACK_OR_REMOVE
-- 
2.39.5