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;
*/
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) )
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)
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()