From: Rudolf Polzer Date: Mon, 14 Jan 2013 10:21:21 +0000 (+0100) Subject: add visual-rank X-Git-Tag: xonotic-v0.7.0~128 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=789f8076506b24567bfa7d2327a01300c2cf30f6;p=xonotic%2Fxonotic-data.pk3dir.git add visual-rank --- diff --git a/qcsrc/server/playerstats.qc b/qcsrc/server/playerstats.qc index 46e30bb99..f18c81e0a 100644 --- a/qcsrc/server/playerstats.qc +++ b/qcsrc/server/playerstats.qc @@ -366,10 +366,12 @@ void PlayerStats_AddGlobalInfo(entity p) p.playerstats_id = string_null; } +.float visual_rank; void PlayerStats_EndMatch(float finished) { - entity p, winner; - winner = PlayerScore_Sort(score_dummyfield, 0); + entity p; + PlayerScore_Sort(score_dummyfield, 0); + PlayerScore_Sort(visual_rank, 1); FOR_EACH_CLIENT(p) // spectators intentionally not included { //PlayerStats_Accuracy(p); // stats are already written with PlayerStats_AddGlobalInfo(entity), don't double them up. @@ -393,6 +395,7 @@ void PlayerStats_EndMatch(float finished) PlayerStats_Event(p, PLAYERSTATS_WINS, p.winning); PlayerStats_Event(p, PLAYERSTATS_MATCHES, 1); PlayerStats_Event(p, PLAYERSTATS_RANK, p.score_dummyfield); + PlayerStats_Event(p, PLAYERSTATS_VISUAL_RANK, p.visual_rank); } } } diff --git a/qcsrc/server/playerstats.qh b/qcsrc/server/playerstats.qh index 11a311028..3702deba5 100644 --- a/qcsrc/server/playerstats.qh +++ b/qcsrc/server/playerstats.qh @@ -6,6 +6,7 @@ string PLAYERSTATS_MATCHES = "matches"; string PLAYERSTATS_JOINS = "joins"; string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid"; string PLAYERSTATS_RANK = "rank"; +string PLAYERSTATS_VISUAL_RANK = "visual-rank"; string PLAYERSTATS_TOTAL = "total-"; string PLAYERSTATS_SCOREBOARD = "scoreboard-";