]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Round down the midway score between the 2 flags if either has a score
authorMario <mario@smbclan.net>
Fri, 3 Mar 2017 16:44:21 +0000 (02:44 +1000)
committerMario <mario@smbclan.net>
Fri, 3 Mar 2017 16:44:21 +0000 (02:44 +1000)
qcsrc/server/mutators/mutator/gamemode_ctf.qc

index 6b497227244a7f0eb04b849fbae1d0d75e495dfb..4681b0ef1641c7ba821bcbec28fcbc7737cc084a 100644 (file)
@@ -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);