From 9de5ff7ef48ed83ac2c079fcbadf9b9ce50169e9 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 16 Nov 2015 01:28:27 +1000 Subject: [PATCH] Add an option to auto return if the toucher is already carrying a flag in manual return mode --- gamemodes.cfg | 1 + qcsrc/server/mutators/mutator/gamemode_ctf.qc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gamemodes.cfg b/gamemodes.cfg index 2d8d54067..60b791f0c 100644 --- a/gamemodes.cfg +++ b/gamemodes.cfg @@ -257,6 +257,7 @@ set g_ctf 0 "Capture The Flag: take the enemy flag and bring it to yours at your set g_ctf_oneflag 1 "Allow oneflag CTF mode on maps that support it" set g_ctf_oneflag_reverse 0 "apply reverse mode to oneflag CTF (take flag to enemy bases to cap), overrides g_ctf_reverse only in oneflag, g_ctf_reverse still affects oneflag" set g_ctf_flag_return 1 "auto return the flag to base when touched by a teammate" +set g_ctf_flag_return_carrying 0 "(manual return mode) auto return the flag to base if touched by a flag carrier" set g_ctf_flag_return_carried_radius 100 "allow flags to be returned by carrier if base is within this radius" set g_ctf_flag_return_time 15 set g_ctf_flag_return_dropped 100 diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index ca38f2107..95b219ea0 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -249,6 +249,7 @@ bool autocvar_g_ctf_flag_dropped_floatinwater; bool autocvar_g_ctf_flag_glowtrails; int autocvar_g_ctf_flag_health; bool autocvar_g_ctf_flag_return; +bool autocvar_g_ctf_flag_return_carrying; float autocvar_g_ctf_flag_return_carried_radius; float autocvar_g_ctf_flag_return_time; bool autocvar_g_ctf_flag_return_when_unreachable; @@ -1246,7 +1247,7 @@ METHOD(Flag, giveTo, bool(Flag this, entity flag, entity toucher)) case FLAG_DROPPED: { - if(CTF_SAMETEAM(toucher, flag) && (autocvar_g_ctf_flag_return || num_perteam <= 1) && flag.team) // automatically return if there's only 1 player on the team + if(CTF_SAMETEAM(toucher, flag) && (autocvar_g_ctf_flag_return || num_perteam <= 1 || (autocvar_g_ctf_flag_return_carrying && toucher.flagcarried)) && flag.team) // automatically return if there's only 1 player on the team ctf_Handle_Return(flag, toucher); // toucher just returned his own flag else if(is_not_monster && (!toucher.flagcarried) && ((toucher != flag.ctf_dropper) || (time > flag.ctf_droptime + autocvar_g_ctf_flag_collect_delay))) ctf_Handle_Pickup(flag, toucher, PICKUP_DROPPED); // toucher just picked up a dropped enemy flag -- 2.39.2