From: Lyberta Date: Sat, 3 Jun 2017 15:38:55 +0000 (+0300) Subject: Added PlayerScore_Get function. X-Git-Tag: xonotic-v0.8.5~2739^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8d6658c5c1a57d227089e108635a40c9db3d70c2;p=xonotic%2Fxonotic-data.pk3dir.git Added PlayerScore_Get function. --- diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 09f230dd6..0842997ba 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -347,6 +347,11 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score) return (s.(scores(scorefield)) += score); } +float PlayerScore_Get(entity player, PlayerScoreField scorefield) +{ + return player.scorekeeper.scores(scorefield); +} + float PlayerTeamScore_Add(entity player, PlayerScoreField pscorefield, float tscorefield, float score) { float r; diff --git a/qcsrc/server/scores.qh b/qcsrc/server/scores.qh index cf7676590..60de66904 100644 --- a/qcsrc/server/scores.qh +++ b/qcsrc/server/scores.qh @@ -24,6 +24,14 @@ void PlayerScore_Detach(entity player); */ float PlayerScore_Add(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); + /** * Initialize the score of this player if needed. * Does nothing in teamplay.