]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
PlayerScore_Add optimization.
authorLyberta <lyberta@lyberta.net>
Sat, 3 Jun 2017 16:20:22 +0000 (19:20 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 3 Jun 2017 16:20:22 +0000 (19:20 +0300)
qcsrc/server/scores.qc

index 09f230dd6bf4bcfa29a50a44171d0a7688f75e06..ea140c67ec481a5a9010654d808d40af4fc5cc0f 100644 (file)
@@ -339,9 +339,12 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
                LOG_WARN("Adding score to unknown player!");
                return 0;
        }
-       if(score)
-               if(scores_label(scorefield) != "")
-                       s.SendFlags |= (2 ** (scorefield.m_id % 16));
+       if(!score)
+       {
+               return (s.(scores(scorefield));
+       }
+       if(scores_label(scorefield) != "")
+               s.SendFlags |= (2 ** (scorefield.m_id % 16));
        if(!warmup_stage)
                PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label(scorefield)), score);
        return (s.(scores(scorefield)) += score);