]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added PlayerScore_Get function.
authorLyberta <lyberta@lyberta.net>
Sat, 3 Jun 2017 15:38:55 +0000 (18:38 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 3 Jun 2017 15:38:55 +0000 (18:38 +0300)
qcsrc/server/scores.qc
qcsrc/server/scores.qh

index 09f230dd6bf4bcfa29a50a44171d0a7688f75e06..0842997ba423c772cc8c7c8c0f628bc695399ea5 100644 (file)
@@ -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;
index cf767659056d5f9cef2a39ae063d18a5923c8c5e..60de66904bf66f1513b051906279664b43868a3f 100644 (file)
@@ -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.