From: Mario Date: Fri, 3 Mar 2017 15:18:20 +0000 (+1000) Subject: Add flag grouping X-Git-Tag: xonotic-v0.8.2~153 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c9134c95472d29abde7a98017e50b293429e65bd;p=xonotic%2Fxonotic-data.pk3dir.git Add flag grouping --- diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 5c8b78cd9..6b4972272 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -569,6 +569,7 @@ void ctf_Handle_Capture(entity flag, entity toucher, int capturetype) if(!player) { return; } // without someone to give the reward to, we can't possibly cap if(CTF_DIFFTEAM(player, flag)) { return; } + if((flag.cnt || enemy_flag.cnt) && flag.cnt != enemy_flag.cnt) { return; } // this should catch some edge cases (capturing grouped flag at ungrouped flag disallowed etc) if(ctf_oneflag) for(tmp_entity = ctf_worldflaglist; tmp_entity; tmp_entity = tmp_entity.ctf_worldflagnext) @@ -1204,7 +1205,12 @@ void ctf_Reset(entity this) bool ctf_FlagBase_Customize(entity this, entity client) { - if(client.flagcarried && CTF_SAMETEAM(client, client.flagcarried)) + entity e = WaypointSprite_getviewentity(client); + entity wp_owner = this.owner; + entity flag = e.flagcarried; + if(flag && CTF_SAMETEAM(e, flag)) + return false; + if(flag && (flag.cnt || wp_owner.cnt) && wp_owner.cnt != flag.cnt) return false; return true; } @@ -1275,7 +1281,7 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e // crudely force them all to 0 if(autocvar_g_ctf_score_ignore_fields) - flag.score_assist = flag.score_capture = flag.score_drop = flag.score_pickup = flag.score_return = 0; + flag.cnt = flag.score_assist = flag.score_team_capture = flag.score_capture = flag.score_drop = flag.score_pickup = flag.score_return = 0; string teamname = Static_Team_ColorName_Lower(teamnumber); // appearence