From: Mario Date: Mon, 8 Oct 2018 14:26:50 +0000 (+1000) Subject: Add an option to remove the player's projectiles when they suicide in CTS X-Git-Tag: xonotic-v0.8.5~1787^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fe96e6119f15a0dadde06b3b9200888fe6315633;p=xonotic%2Fxonotic-data.pk3dir.git Add an option to remove the player's projectiles when they suicide in CTS --- 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)