From: Mario <mario.mario@y7mail.com>
Date: Fri, 13 Dec 2013 01:06:04 +0000 (+1100)
Subject: Retrieve weapon name from client, rather than networking it
X-Git-Tag: xonotic-v0.8.0~152^2~222
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=591bf7cf6244db282437577f96e006653b4c60a5;p=xonotic%2Fxonotic-data.pk3dir.git

Retrieve weapon name from client, rather than networking it
---

diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc
index bab39d4009..b719fd9247 100644
--- a/qcsrc/client/Main.qc
+++ b/qcsrc/client/Main.qc
@@ -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();
 
diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc
index d26ed831fb..cb4159f139 100644
--- a/qcsrc/server/weapons/selection.qc
+++ b/qcsrc/server/weapons/selection.qc
@@ -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");
diff --git a/qcsrc/server/weapons/selection.qh b/qcsrc/server/weapons/selection.qh
index 17310eb819..8e2937f0ca 100644
--- a/qcsrc/server/weapons/selection.qh
+++ b/qcsrc/server/weapons/selection.qh
@@ -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);