]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a bad hack to fix CTS not forcing the switch to a newly picked up weapon
authorMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 13:04:18 +0000 (23:04 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 13:04:18 +0000 (23:04 +1000)
qcsrc/server/t_items.qc

index c78b2fda9c9fb83ee3c3048ab3c36aeafd99c84c..bf222ea33c49735f026bd637662b945272b8ddd8 100644 (file)
@@ -669,6 +669,13 @@ float Item_GiveTo(entity item, entity player)
        if (!pickedup)
                return 0;
 
+       // crude hack to enforce switching weapons
+       if(g_cts && (item.flags & FL_WEAPON))
+       {
+               W_SwitchWeapon_Force(player, item.weapon);
+               return 1;
+       }
+
        if (_switchweapon)
                if (player.switchweapon != w_getbestweapon(player))
                        W_SwitchWeapon_Force(player, w_getbestweapon(player));