From 1b66e7bf8e5f47da8a022b491ad4f243c5168b79 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Sat, 3 Jun 2017 19:20:22 +0300 Subject: [PATCH] PlayerScore_Add optimization. --- qcsrc/server/scores.qc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 09f230dd6..ea140c67e 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -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); -- 2.39.2