From fe96e6119f15a0dadde06b3b9200888fe6315633 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 9 Oct 2018 00:26:50 +1000 Subject: [PATCH] Add an option to remove the player's projectiles when they suicide in CTS --- gamemodes-server.cfg | 1 + qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 530e88818..1ceea67f0 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -318,6 +318,7 @@ set g_cts 0 "CTS: complete the stage" set g_cts_selfdamage 1 "0 = disable all selfdamage and falldamage in cts" set g_cts_finish_kill_delay 10 "prevent cheating by running back to the start line, and starting out with more speed than otherwise possible" set g_cts_send_rankings_cnt 15 "send this number of map records to clients" +set g_cts_removeprojectiles 0 "remove projectiles when the player dies, to prevent using weapons earlier in the stage than intended" // ========================== diff --git a/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc index 636aeb6de..31bdae079 100644 --- a/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc +++ b/qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc @@ -5,6 +5,7 @@ float autocvar_g_cts_finish_kill_delay; bool autocvar_g_cts_selfdamage; +bool autocvar_g_cts_removeprojectiles; // legacy bot roles .float race_checkpoint; @@ -253,6 +254,14 @@ MUTATOR_HOOKFUNCTION(cts, PlayerDies) frag_target.respawn_flags |= RESPAWN_FORCE; race_AbandonRaceCheck(frag_target); + + if(autocvar_g_cts_removeprojectiles) + { + IL_EACH(g_projectiles, it.owner == frag_target && (it.flags & FL_PROJECTILE), + { + delete(it); + }); + } } MUTATOR_HOOKFUNCTION(cts, HavocBot_ChooseRole) -- 2.39.2