X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores.qh;h=ad406196635a55b1ecf60667d653eba8a21c27bc;hb=e7b84d1ea38e1f9af6068955a4ccd9b5fcdb2913;hp=60de66904bf66f1513b051906279664b43868a3f;hpb=8d6658c5c1a57d227089e108635a40c9db3d70c2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/scores.qh b/qcsrc/server/scores.qh index 60de66904..ad4061966 100644 --- a/qcsrc/server/scores.qh +++ b/qcsrc/server/scores.qh @@ -1,6 +1,6 @@ #pragma once -#include +#include entity scores_initialized; // non-NULL when scores labels/rules have been set .float scoreboard_pos; @@ -24,13 +24,21 @@ void PlayerScore_Detach(entity player); */ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score); +/** + * Sets the player's score to the score parameter. + * NEVER call this if PlayerScore_Attach has not been called yet! + * Means: FIXME make players unable to join the game when not called ClientConnect yet. + * Returns the new (or old if unchanged) score. + */ +float PlayerScore_Set(entity player, PlayerScoreField scorefield, float score); + /** * \brief Returns the player's score. * \param[in] player Player to inspect. * \param[in] scorefield Field of the score. * \return Player's score. */ -float PlayerScore_Get(entity player, PlayerScoreField scorefield); +#define PlayerScore_Get(player, scorefield) PlayerScore_Add(player, scorefield, 0) /** * Initialize the score of this player if needed. @@ -52,7 +60,7 @@ float TeamScore_Add(entity player, float scorefield, float score); * NEVER call this if team has not been set yet! * Returns the new score. */ -float TeamScore_AddToTeam(float t, float scorefield, float score); +float TeamScore_AddToTeam(int t, float scorefield, float score); /** * Returns a value indicating the team score (and higher is better). @@ -65,11 +73,6 @@ float TeamScore_GetCompareValue(float t); */ float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score); -/** - * Adds to the generic score fields for both the player and the team. - */ -#define PlayerTeamScore_AddScore(p, s) PlayerTeamScore_Add(p, SP_SCORE, ST_SCORE, s) - /** * Set the label of a team score item, as well as the scoring flags. */