From: terencehill Date: Sun, 22 May 2022 11:54:39 +0000 (+0200) Subject: Ignore elo and fps sorting players in the server (client scoreboard already does) X-Git-Tag: xonotic-v0.8.6~319^2~7 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=b6091ccd32e2fbddee57bdddf943ebbc035842f0;p=xonotic%2Fxonotic-data.pk3dir.git Ignore elo and fps sorting players in the server (client scoreboard already does) --- diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index ed8715e02..393e15c13 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -176,6 +176,8 @@ void Scoreboard_InitScores() ps_primary = ps_secondary = NULL; ts_primary = ts_secondary = -1; FOREACH(Scores, true, { + if(scores_flags(it) & SFL_NOT_SORTABLE) + continue; f = (scores_flags(it) & SFL_SORT_PRIO_MASK); if(f == SFL_SORT_PRIO_PRIMARY) ps_primary = it; diff --git a/qcsrc/common/scores.qh b/qcsrc/common/scores.qh index 45af93992..28d6ad576 100644 --- a/qcsrc/common/scores.qh +++ b/qcsrc/common/scores.qh @@ -117,15 +117,17 @@ const int SFL_RANK = BIT(5); */ const int SFL_TIME = BIT(6); +const int SFL_NOT_SORTABLE = BIT(7); // don't sort by this field + // not an extra constant yet #define SFL_ZERO_IS_WORST SFL_TIME /** * Scoring priority (NOTE: PRIMARY is used for fraglimit) */ -const int SFL_SORT_PRIO_SECONDARY = 4; -const int SFL_SORT_PRIO_PRIMARY = 8; -const int SFL_SORT_PRIO_MASK = 12; +const int SFL_SORT_PRIO_SECONDARY = BIT(2); +const int SFL_SORT_PRIO_PRIMARY = BIT(3); +const int SFL_SORT_PRIO_MASK = SFL_SORT_PRIO_PRIMARY | SFL_SORT_PRIO_SECONDARY; #define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER ) #define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) ) diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index b6244ee24..bc4d8947c 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -26,6 +26,8 @@ float teamscores_flags_primary; vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags, vector previous, bool strict) // returns: cmp value, best prio { + if(fieldflags & SFL_NOT_SORTABLE) // column does not sort + return previous; if(!strict && !(fieldflags & SFL_SORT_PRIO_MASK)) // column does not sort return previous; if((fieldflags & SFL_SORT_PRIO_MASK) < previous.y) diff --git a/qcsrc/server/scores_rules.qc b/qcsrc/server/scores_rules.qc index 2749db38e..ea682584a 100644 --- a/qcsrc/server/scores_rules.qc +++ b/qcsrc/server/scores_rules.qc @@ -55,10 +55,10 @@ void ScoreRules_basics(int teams, float sprio, float stprio, float score_enabled ScoreInfo_SetLabel_PlayerScore(SP_DMG, "dmg", 0); ScoreInfo_SetLabel_PlayerScore(SP_DMGTAKEN, "dmgtaken", SFL_LOWER_IS_BETTER); - ScoreInfo_SetLabel_PlayerScore(SP_ELO, "elo", 0); + ScoreInfo_SetLabel_PlayerScore(SP_ELO, "elo", SFL_NOT_SORTABLE); if(STAT(SHOWFPS)) - ScoreInfo_SetLabel_PlayerScore(SP_FPS, "fps", 0); + ScoreInfo_SetLabel_PlayerScore(SP_FPS, "fps", SFL_NOT_SORTABLE); } void ScoreRules_basics_end()