X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores.qh;h=8c9af4534fa1158106727abaf7b52716f4ad0908;hb=6f37a8f8076a572097afb13de2c367a72717c927;hp=f94b683323dfb8b57d974c7d2b2dd683ace5d90b;hpb=f6bbdd98e1a553e2bc4fa74a9d0b2f517137b9ff;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/scores.qh b/qcsrc/server/scores.qh index f94b68332..8c9af4534 100644 --- a/qcsrc/server/scores.qh +++ b/qcsrc/server/scores.qh @@ -1,8 +1,12 @@ +#ifndef SCORES_H +#define SCORES_H + +#include "../common/constants.qh" + entity scores_initialized; // non-world when scores labels/rules have been set .float scores[MAX_SCORE]; .float teamscores[MAX_TEAMSCORE]; - -.float scores_accumulated[MAX_SCORE]; // for player stats only +.float scoreboard_pos; /** * Attaches a PlayerScore entity to a player. Use that in ClientConnect. @@ -27,8 +31,9 @@ float PlayerScore_Add(entity player, float scorefield, float score); * Initialize the score of this player if needed. * Does nothing in teamplay. * Use that when a spectator becomes a player. + * Returns whether clearing has been performed */ -void PlayerScore_Clear(entity player); +float PlayerScore_Clear(entity player); /** * Adds a score to the player's team's scores. @@ -119,5 +124,9 @@ string GetTeamScoreString(float tm, float shortString); * Sorts the players and stores their place in the given field, starting with * 1. Non-players get 0 written into that field. * Returns the beginning of a sorted chain of the non-spectators. + * teams: >0: sort by teams first (always strict ordering); <0: sort by teams only (respects strict flag) + * strict: return a strict ordering + * nospectators: exclude spectators */ -entity PlayerScore_Sort(.float field); +entity PlayerScore_Sort(.float field, float teams, float strict, float nospectators); +#endif