From: Samual Lenks Date: Mon, 10 Sep 2012 03:19:53 +0000 (-0400) Subject: Score rules should be set up in the initiation part of the game mode code X-Git-Tag: xonotic-v0.7.0~240^2~15 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=746492aae85a9c888e232cfe31e17f7a6378d8ac;p=xonotic%2Fxonotic-data.pk3dir.git Score rules should be set up in the initiation part of the game mode code --- diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 7cfd3a3b7..df07fbce1 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -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() diff --git a/qcsrc/server/mutators/gamemode_ctf.qh b/qcsrc/server/mutators/gamemode_ctf.qh index 0b5c3471d..ff893b61e 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qh +++ b/qcsrc/server/mutators/gamemode_ctf.qh @@ -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') diff --git a/qcsrc/server/scores_rules.qc b/qcsrc/server/scores_rules.qc index 8266d4e3c..302938b26 100644 --- a/qcsrc/server/scores_rules.qc +++ b/qcsrc/server/scores_rules.qc @@ -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