]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a temporary client-server option to allow turning off auto switching in CTS
authorMario <mario@smbclan.net>
Wed, 26 Sep 2018 00:30:44 +0000 (10:30 +1000)
committerMario <mario@smbclan.net>
Wed, 26 Sep 2018 00:30:44 +0000 (10:30 +1000)
qcsrc/common/t_items.qc
qcsrc/server/client.qh
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc
xonotic-client.cfg

index 0d4d2b92ab2c7221621379a5bf0b77b2d0730146..dfee5330df713431f4afba5cc9be713504171323 100644 (file)
@@ -856,7 +856,7 @@ float Item_GiveTo(entity item, entity player)
                return 0;
 
        // crude hack to enforce switching weapons
-       if(g_cts && item.itemdef.instanceOfWeaponPickup)
+       if(g_cts && item.itemdef.instanceOfWeaponPickup && !CS(player).cvar_cl_cts_noautoswitch)
        {
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
index 26388e7b37e417cab785c318673ffec45462c6a5..80965de759808a0fb8b9c0fe190532b4b4d10ef2 100644 (file)
@@ -145,6 +145,7 @@ CLASS(Client, Object)
     ATTRIB(Client, cvar_cl_accuracy_data_receive, bool, this.cvar_cl_accuracy_data_receive);
     ATTRIBARRAY(Client, cvar_cl_weaponpriorities, string, 10);
     ATTRIB(Client, cvar_cl_weaponpriority, string, this.cvar_cl_weaponpriority);
+    ATTRIB(Client, cvar_cl_cts_noautoswitch, bool, this.cvar_cl_cts_noautoswitch);
 
     METHOD(Client, m_unwind, bool(Client this));
 
index 58111fb12bcfea9482a8d89b6d0dbceaf31ab42e..8f4e903490b04d211835f781adad688507ad5010 100644 (file)
@@ -168,6 +168,7 @@ float default_weapon_alpha;
 .float cvar_cl_jetpack_jump;
 .float cvar_cl_movement_track_canjump;
 .float cvar_cl_newusekeysupported;
+.float cvar_cl_cts_noautoswitch;
 
 .string cvar_g_xonoticversion;
 .string cvar_cl_weaponpriority;
index cf7266b483a9cb837b6a879ee35559128556da3d..47c0cb2fe4615af49105c651d2bc3192c9452b5f 100644 (file)
@@ -416,6 +416,8 @@ REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode");
 
 REPLICATE(cvar_g_xonoticversion, string, "g_xonoticversion");
 
+REPLICATE(cvar_cl_cts_noautoswitch, bool, "cl_cts_noautoswitch");
+
 /**
  * @param f -1: cleanup, 0: request, 1: receive
  */
index ed81e0fb558ebb17c1645912208ab96e1f161e8b..51c66081fc539c0d324b3573f4aadeb7cbba3423 100644 (file)
@@ -650,6 +650,8 @@ seta cl_jetpack_jump 1 "Activate jetpack by pressing jump in the air. 0 = Disabl
 seta cl_race_cptimes_showself 1 "Always show your own times as well as the current best on checkpoints in Race/CTS"
 seta cl_race_cptimes_onlyself 0 "Only show your own times on checkpoints in Race/CTS"
 
+seta cl_cts_noautoswitch 0 "Prevent forced switching to new weapons in CTS"
+
 set cl_stripcolorcodes 0       "experimental feature (notes: strips ALL color codes from messages!)"
 
 // Demo camera