]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Score rules should be set up in the initiation part of the game mode code
authorSamual Lenks <samual@xonotic.org>
Mon, 10 Sep 2012 03:19:53 +0000 (23:19 -0400)
committerSamual Lenks <samual@xonotic.org>
Mon, 10 Sep 2012 03:19:53 +0000 (23:19 -0400)
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_ctf.qh
qcsrc/server/scores_rules.qc

index 7cfd3a3b719acdab5df3175e74bf1c7367951763..df07fbce1ac6fabd907898e157177314a6a5755d 100644 (file)
@@ -1343,6 +1343,21 @@ void spawnfunc_ctf_team()
 // Initialization
 // ==============
 
+// scoreboard setup
+void ctf_ScoreRules()
+{
+       CheckAllowedTeams(world);
+       ScoreRules_basics(2, SFL_SORT_PRIO_PRIMARY, 0, TRUE);
+       ScoreInfo_SetLabel_TeamScore  (ST_CTF_CAPS,     "caps",      SFL_SORT_PRIO_PRIMARY);
+       ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS,     "caps",      SFL_SORT_PRIO_SECONDARY);
+       ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPTIME,  "captime",   SFL_LOWER_IS_BETTER | SFL_TIME);
+       ScoreInfo_SetLabel_PlayerScore(SP_CTF_PICKUPS,  "pickups",   0);
+       ScoreInfo_SetLabel_PlayerScore(SP_CTF_FCKILLS,  "fckills",   0);
+       ScoreInfo_SetLabel_PlayerScore(SP_CTF_RETURNS,  "returns",   0);
+       ScoreInfo_SetLabel_PlayerScore(SP_CTF_DROPS,    "drops",     SFL_LOWER_IS_BETTER);
+       ScoreRules_basics_end();
+}
+
 // code from here on is just to support maps that don't have flag and team entities
 void ctf_SpawnTeam (string teamname, float teamcolor)
 {
@@ -1368,7 +1383,7 @@ void ctf_DelayedInit() // Do this check with a delay so we can wait for teams to
                ctf_SpawnTeam("Blue", COLOR_TEAM2 - 1);
        }
        
-       ScoreRules_ctf();
+       ctf_ScoreRules();
 }
 
 void ctf_Initialize()
index 0b5c3471d6e5d29e70fa2dc941fd90e8238209f5..ff893b61e21e7d4d1b1cb5ac66618589fe3ac36c 100644 (file)
@@ -12,6 +12,15 @@ void spawnfunc_item_flag_team1();
 void spawnfunc_item_flag_team2();
 void spawnfunc_ctf_team();
 
+// score rule declarations
+#define ST_CTF_CAPS 1
+#define SP_CTF_CAPS 4
+#define SP_CTF_CAPTIME 5
+#define SP_CTF_PICKUPS 6
+#define SP_CTF_DROPS 7
+#define SP_CTF_FCKILLS 8
+#define SP_CTF_RETURNS 9
+
 // flag constants // for most of these, there is just one question to be asked: WHYYYYY?
 #define FLAG_MIN (PL_MIN + '0 0 -13')
 #define FLAG_MAX (PL_MAX + '0 0 -13')
index 8266d4e3c4b55cf158def74ded2a15f4c2c42d79..302938b267d67ba0261c574e67b9798b9aec539f 100644 (file)
@@ -44,28 +44,6 @@ void ScoreRules_generic()
        ScoreRules_basics_end();
 }
 
-// g_ctf
-#define ST_CTF_CAPS 1
-#define SP_CTF_CAPS 4
-#define SP_CTF_CAPTIME 5
-#define SP_CTF_PICKUPS 6
-#define SP_CTF_DROPS 7
-#define SP_CTF_FCKILLS 8
-#define SP_CTF_RETURNS 9
-void ScoreRules_ctf()
-{
-       CheckAllowedTeams(world);
-       ScoreRules_basics(2, SFL_SORT_PRIO_PRIMARY, 0, TRUE);
-       ScoreInfo_SetLabel_TeamScore  (ST_CTF_CAPS,     "caps",      SFL_SORT_PRIO_PRIMARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS,     "caps",      SFL_SORT_PRIO_SECONDARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPTIME,  "captime",   SFL_LOWER_IS_BETTER | SFL_TIME);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_PICKUPS,  "pickups",   0);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_FCKILLS,  "fckills",   0);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_RETURNS,  "returns",   0);
-       ScoreInfo_SetLabel_PlayerScore(SP_CTF_DROPS,    "drops",     SFL_LOWER_IS_BETTER);
-       ScoreRules_basics_end();
-}
-
 // g_domination
 #define ST_DOM_TICKS 1
 #define SP_DOM_TICKS 4