]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Retrieve weapon name from client, rather than networking it
authorMario <mario.mario@y7mail.com>
Fri, 13 Dec 2013 01:06:04 +0000 (12:06 +1100)
committerMario <mario.mario@y7mail.com>
Fri, 13 Dec 2013 01:06:04 +0000 (12:06 +1100)
qcsrc/client/Main.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/selection.qh

index bab39d4009f3c3409fb0267674a167795adbde32..b719fd92479ff979e2918dc656b39f37a2452e80 100644 (file)
@@ -1166,7 +1166,7 @@ void Net_WeaponComplain()
 
        if(complain_weapon_name)
                strunzone(complain_weapon_name);
-       complain_weapon_name = strzone(ReadString());
+       complain_weapon_name = strzone(W_Name(complain_weapon));
 
        complain_weapon_type = ReadByte();
 
index d26ed831fbf05b7e4b427c6833705e97c80814b9..cb4159f139fa51bf6a7e4a40fb9365a655665719 100644 (file)
@@ -1,11 +1,10 @@
 // switch between weapons
-void Send_WeaponComplain(entity e, float wpn, string wpnname, float type)
+void Send_WeaponComplain(entity e, float wpn, float type)
 {
        msg_entity = e;
        WriteByte(MSG_ONE, SVC_TEMPENTITY);
        WriteByte(MSG_ONE, TE_CSQC_WEAPONCOMPLAIN);
        WriteByte(MSG_ONE, wpn);
-       WriteString(MSG_ONE, wpnname);
        WriteByte(MSG_ONE, type);
 }
 
@@ -58,7 +57,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                                if(IS_REAL_CLIENT(cl))
                                {
                                        play2(cl, "weapons/unavailable.wav");
-                                       Send_WeaponComplain (cl, wpn, W_Name(wpn), 0);
+                                       Send_WeaponComplain (cl, wpn, 0);
                                }
                                return FALSE;
                        }
@@ -71,7 +70,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                // Report Proper Weapon Status / Modified Weapon Ownership Message
                if (weaponsInMap & WepSet_FromWeapon(wpn))
                {
-                       Send_WeaponComplain(cl, wpn, W_Name(wpn), 1);
+                       Send_WeaponComplain(cl, wpn, 1);
 
                        if(autocvar_g_showweaponspawns)
                        {
@@ -101,7 +100,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                }
                else
                {
-                       Send_WeaponComplain (cl, wpn, W_Name(wpn), 2);
+                       Send_WeaponComplain (cl, wpn, 2);
                }
 
                play2(cl, "weapons/unavailable.wav");
index 17310eb819e881237b2d7ca34e99f1bb74f11199..8e2937f0ca98c859b36614a9a9950e918f673827 100644 (file)
@@ -1,5 +1,5 @@
 // switch between weapons
-void Send_WeaponComplain(entity e, float wpn, string wpnname, float type);
+void Send_WeaponComplain(entity e, float wpn, float type);
 
 .float hasweapon_complain_spam;
 float client_hasweapon(entity cl, float wpn, float andammo, float complain);