]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Ignore elo and fps sorting players in the server (client scoreboard already does)
authorterencehill <piuntn@gmail.com>
Sun, 22 May 2022 11:54:39 +0000 (13:54 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 22 May 2022 12:00:36 +0000 (14:00 +0200)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/scores.qh
qcsrc/server/scores.qc
qcsrc/server/scores_rules.qc

index ed8715e022909cd1545784a29c222d3d1d130c92..393e15c13feb92b91601915fafa1355248a66e35 100644 (file)
@@ -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;
index 45af93992aacdf33f7d8338867fe73a43807b2a3..28d6ad57637f6cbfac4f713893308e62faad2bef 100644 (file)
@@ -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) )
index b6244ee24ba2a5e8eb820e9a59581433f8c34374..bc4d8947c293b32f20f6f338b3f13b854c8c42ab 100644 (file)
@@ -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)
index 2749db38e63c081aa3aa9425c0e674c4e10c270e..ea682584a3389d6e4eaec2fe064a5c1ecb439c39 100644 (file)
@@ -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()