r1690 - in branches/nexuiz-2.0/data: . menu/data qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Jun 28 17:47:28 EDT 2006


Author: kadaverjack
Date: 2006-06-28 17:47:28 -0400 (Wed, 28 Jun 2006)
New Revision: 1690

Modified:
   branches/nexuiz-2.0/data/default.cfg
   branches/nexuiz-2.0/data/menu/data/weapon.menu
   branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc
   branches/nexuiz-2.0/data/qcsrc/server/constants.qh
   branches/nexuiz-2.0/data/qcsrc/server/t_items.qc
Log:
weapon stay fixes from trunk


Modified: branches/nexuiz-2.0/data/default.cfg
===================================================================
--- branches/nexuiz-2.0/data/default.cfg	2006-06-28 21:41:56 UTC (rev 1689)
+++ branches/nexuiz-2.0/data/default.cfg	2006-06-28 21:47:28 UTC (rev 1690)
@@ -156,6 +156,7 @@
 
 pausable 0
 set g_antilag 0
+set g_weapon_stay 0
 set g_start_weapon_laser 1
 set g_start_weapon_shotgun 1
 set g_start_weapon_uzi 0

Modified: branches/nexuiz-2.0/data/menu/data/weapon.menu
===================================================================
--- branches/nexuiz-2.0/data/menu/data/weapon.menu	2006-06-28 21:41:56 UTC (rev 1689)
+++ branches/nexuiz-2.0/data/menu/data/weapon.menu	2006-06-28 21:47:28 UTC (rev 1690)
@@ -41,16 +41,10 @@
 	}
 	Item Data_Cvar WeaponStay
 	{
-		cvarName	"deathmatch"
-		defValue        "1"
+		cvarName	"g_weapon_stay"
+		defValue        "0"
 		
-		Item DataLink_TextSwitch Switch
-		{
-			valueList       "'1' '2'"
-			
-			descList        "'Off' 'On'"
-			link            "##up"
-                }
+		[DataLink_OnOffSwitch]
         }
 
 	Item Data_Cvar LaserDamage

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc	2006-06-28 21:41:56 UTC (rev 1689)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc	2006-06-28 21:47:28 UTC (rev 1690)
@@ -161,6 +161,7 @@
 	wep.nextthink = time + 0.5;
 	wep.think = thrown_wep_think;
 	wep.classname = "droppedweapon";
+	wep.flags = wep.flags | FL_TOSSED;
 	e.items = e.items - (e.items & w);
 	e.switchweapon = w_getbestweapon(e);
 	wep.colormap = e.colormap;

Modified: branches/nexuiz-2.0/data/qcsrc/server/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2006-06-28 21:41:56 UTC (rev 1689)
+++ branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2006-06-28 21:47:28 UTC (rev 1690)
@@ -17,6 +17,7 @@
 float	FL_WEAPON				= 8192;
 float	FL_POWERUP				= 16384;
 float	FL_PROJECTILE				= 32768;
+float	FL_TOSSED				= 65536;
 
 float	MOVETYPE_NONE				= 0;
 float	MOVETYPE_ANGLENOCLIP			= 1;

Modified: branches/nexuiz-2.0/data/qcsrc/server/t_items.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_items.qc	2006-06-28 21:41:56 UTC (rev 1689)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_items.qc	2006-06-28 21:47:28 UTC (rev 1690)
@@ -97,8 +97,13 @@
 	}
 	else
 	{
-		if (cvar("deathmatch") == 2 && self.flags & FL_WEAPON && other.items & self.items && self.classname != "droppedweapon")
-			return;
+		if (cvar("deathmatch") == 2 || cvar("g_weapon_stay"))
+		{
+			if (self.flags & FL_WEAPON && other.items & self.items && self.classname != "droppedweapon")
+				return;
+			if (other.items & self.items && self.flags & FL_TOSSED)	// don't let players stack ammo by tossing weapons
+				return;
+		}
 
 		if (self.ammo_shells)
 			other.ammo_shells = min (other.ammo_shells + self.ammo_shells, 999);
@@ -155,7 +160,7 @@
 
 	if (self.classname == "droppedweapon")
 		remove (self);
-	else if(self.flags & FL_WEAPON && cvar("deathmatch") == 2)
+	else if(self.flags & FL_WEAPON && (cvar("deathmatch") == 2 || cvar("g_weapon_stay")))
 		return;
 	else
 	{




More information about the nexuiz-commits mailing list