From: Mario Date: Fri, 3 Mar 2017 16:44:21 +0000 (+1000) Subject: Round down the midway score between the 2 flags if either has a score X-Git-Tag: xonotic-v0.8.2~152 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b39c34ddf85197bc841a9bf730fe60f7b559b39e;p=xonotic%2Fxonotic-data.pk3dir.git Round down the midway score between the 2 flags if either has a score --- diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 6b4972272..4681b0ef1 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -597,8 +597,14 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype) } // scoring - PlayerTeamScore_AddScore(player, ((enemy_flag.score_capture) ? enemy_flag.score_capture : autocvar_g_ctf_score_capture)); - PlayerTeamScore_Add(player, SP_CTF_CAPS, ST_CTF_CAPS, ((enemy_flag.score_team_capture) ? enemy_flag.score_team_capture : 1)); + float pscore = 0; + if(enemy_flag.score_capture || flag.score_capture) + pscore = floor((max(1, enemy_flag.score_capture) + max(1, flag.score_capture)) * 0.5); + PlayerTeamScore_AddScore(player, ((pscore) ? pscore : autocvar_g_ctf_score_capture)); + float capscore = 0; + if(enemy_flag.score_team_capture || flag.score_team_capture) + capscore = floor((max(1, enemy_flag.score_team_capture) + max(1, flag.score_team_capture)) * 0.5); + PlayerTeamScore_Add(player, SP_CTF_CAPS, ST_CTF_CAPS, ((capscore) ? capscore : 1)); old_time = PlayerScore_Add(player, SP_CTF_CAPTIME, 0); new_time = TIME_ENCODE(time - enemy_flag.ctf_pickuptime);