float scores_flags_primary;
float teamscores_flags_primary;
-vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags, vector previous, float strict) // returns: cmp value, best prio
+vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags, vector previous, bool strict) // returns: cmp value, best prio
{
if(!strict && !(fieldflags & SFL_SORT_PRIO_MASK)) // column does not sort
return previous;
return TeamScore_AddToTeam(player.team, scorefield, score);
}
-float TeamScore_Compare(entity t1, entity t2, float strict)
+float TeamScore_Compare(entity t1, entity t2, bool strict)
{
if(!t1 || !t2) return (!t2) - !t1;
return r;
}
-float PlayerScore_Compare(entity t1, entity t2, float strict)
+float PlayerScore_Compare(entity t1, entity t2, bool strict)
{
if(!t1 || !t2) return (!t2) - !t1;
secondscorekeeper = NULL;
FOREACH_CLIENT(IS_PLAYER(it), {
sk = CS(it).scorekeeper;
- c = PlayerScore_Compare(winnerscorekeeper, sk, 1);
+ c = PlayerScore_Compare(winnerscorekeeper, sk, true);
if(c < 0)
{
WinningConditionHelper_second = WinningConditionHelper_winner;
}
else
{
- c = PlayerScore_Compare(secondscorekeeper, sk, 1);
+ c = PlayerScore_Compare(secondscorekeeper, sk, true);
if(c < 0)
{
WinningConditionHelper_second = it;
}
});
- WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
+ WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, false) == 0);
if(WinningConditionHelper_equality)
WinningConditionHelper_winner = WinningConditionHelper_second = NULL;
return out;
}
-float PlayerTeamScore_Compare(entity p1, entity p2, float teams, float strict)
+float PlayerTeamScore_Compare(entity p1, entity p2, float teams, bool strict)
{
if(teams && teamscores_entities_count)
{
return PlayerScore_Compare(CS(p1).scorekeeper, CS(p2).scorekeeper, strict);
}
-entity PlayerScore_Sort(.float field, float teams, float strict, float nospectators)
+entity PlayerScore_Sort(.float field, int teams, bool strict, bool nospectators)
{
entity p, plist, pprev, pbest, pbestprev, pfirst, plast;
float i, j;
pbest.chain = NULL;
++i;
- if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0))
+ if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, false))
j = i;
pbest.(field) = j;
});
w = bound(6, floor(SCORESWIDTH / t - 1), 9);
- p = PlayerScore_Sort(score_dummyfield, 1, 1, 0);
+ p = PlayerScore_Sort(score_dummyfield, 1, true, false);
t = -1;
if(!teamscores_entities_count)