From: Rudolf Polzer Date: Tue, 29 Jan 2013 08:55:09 +0000 (+0100) Subject: Race/CTS: if you have a fastest lap, you should show up in the scoreboard any time X-Git-Tag: xonotic-v0.7.0~108^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=125ecdc100d35a9ceaa0c3e575726cab5df37c67;p=xonotic%2Fxonotic-data.pk3dir.git Race/CTS: if you have a fastest lap, you should show up in the scoreboard any time --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 165460eeb..062d4474d 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -534,6 +534,13 @@ void PutObserverInServer (void) else self.frags = FRAGS_SPECTATOR; } + else if(g_race) + { + if(PlayerScore_Add(e, SP_RACE_FASTEST, 0)) + self.frags = FRAGS_LMS_LOSER; + else + self.frags = FRAGS_SPECTATOR; + } else self.frags = FRAGS_SPECTATOR; } diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 16f6eca72..2742888b6 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -273,6 +273,10 @@ void race_SendTime(entity e, float cp, float t, float tvalid) } else { + s = PlayerScore_Add(e, SP_RACE_FASTEST, 0); + if(!s || t < s) + PlayerScore_Add(e, SP_RACE_FASTEST, t - s); + s = PlayerScore_Add(e, SP_RACE_TIME, 0); snew = TIME_ENCODE(time - game_starttime); PlayerScore_Add(e, SP_RACE_TIME, snew - s); diff --git a/qcsrc/server/scores_rules.qc b/qcsrc/server/scores_rules.qc index c4021fc39..b7947f0fa 100644 --- a/qcsrc/server/scores_rules.qc +++ b/qcsrc/server/scores_rules.qc @@ -99,9 +99,8 @@ void ScoreRules_kh(float teams) // Race stuff #define ST_RACE_LAPS 1 #define SP_RACE_LAPS 4 -#define SP_RACE_FASTEST 5 #define SP_RACE_TIME 5 -//#define SP_RACE_RANK 6 +#define SP_RACE_FASTEST 6 void ScoreRules_race() { ScoreRules_basics(race_teams, 0, 0, FALSE); @@ -110,7 +109,7 @@ void ScoreRules_race() ScoreInfo_SetLabel_TeamScore( ST_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY); ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY); ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME); - //ScoreInfo_SetLabel_PlayerScore(SP_RACE_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_ALLOW_HIDE); + ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME); } else if(g_race_qualifying) { @@ -118,9 +117,9 @@ void ScoreRules_race() } else { - //ScoreInfo_SetLabel_TeamScore( ST_RACE_LAPS, "laps", 0); ScoreInfo_SetLabel_PlayerScore(SP_RACE_LAPS, "laps", SFL_SORT_PRIO_PRIMARY); ScoreInfo_SetLabel_PlayerScore(SP_RACE_TIME, "time", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER | SFL_TIME); + ScoreInfo_SetLabel_PlayerScore(SP_RACE_FASTEST, "fastest", SFL_LOWER_IS_BETTER | SFL_TIME); } ScoreRules_basics_end(); }