Add an option to remove the player's projectiles when they suicide in CTS 610/head
authorMario <mario@smbclan.net>
Mon, 8 Oct 2018 14:26:50 +0000 (00:26 +1000)
committerMario <mario@smbclan.net>
Mon, 8 Oct 2018 14:26:50 +0000 (00:26 +1000)
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc

index 530e888..1ceea67 100644 (file)
@@ -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"
 
 
 // ==========================
index 636aeb6..31bdae0 100644 (file)
@@ -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)