[nexuiz-commits] r6175 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Mar 15 06:41:13 EDT 2009


Author: div0
Date: 2009-03-15 06:41:13 -0400 (Sun, 15 Mar 2009)
New Revision: 6175

Modified:
   trunk/data/qcsrc/server/cl_weaponsystem.qc
   trunk/data/qcsrc/server/clientcommands.qc
   trunk/data/qcsrc/server/g_casings.qc
   trunk/data/qcsrc/server/w_campingrifle.qc
   trunk/data/qcsrc/server/w_crylink.qc
   trunk/data/qcsrc/server/w_electro.qc
   trunk/data/qcsrc/server/w_grenadelauncher.qc
   trunk/data/qcsrc/server/w_hagar.qc
   trunk/data/qcsrc/server/w_hlac.qc
   trunk/data/qcsrc/server/w_hook.qc
   trunk/data/qcsrc/server/w_laser.qc
   trunk/data/qcsrc/server/w_minstanex.qc
   trunk/data/qcsrc/server/w_nex.qc
   trunk/data/qcsrc/server/w_porto.qc
   trunk/data/qcsrc/server/w_rocketlauncher.qc
   trunk/data/qcsrc/server/w_seeker.qc
   trunk/data/qcsrc/server/w_shotgun.qc
   trunk/data/qcsrc/server/w_uzi.qc
Log:
handle casings using the "shell" tag; make them go left instead of right (fits better); eliminate no longer used shotorg argument from W_SetupShot


Modified: trunk/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weaponsystem.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/cl_weaponsystem.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -31,11 +31,12 @@
 // this function calculates w_shotorg and w_shotdir based on the weapon model
 // offset, trueaim and antilag, and won't put w_shotorg inside a wall.
 // make sure you call makevectors first (FIXME?)
-void W_SetupShot(entity ent, vector vecs, float antilag, float recoil, string snd)
+void W_SetupShot(entity ent, float antilag, float recoil, string snd)
 {
 	float nudge = 1; // added to traceline target and subtracted from result
 	local vector trueaimpoint;
 	local float oldsolid;
+	vector vecs;
 	oldsolid = self.dphitcontentsmask;
 	self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
 	traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * MAX_SHOT_DISTANCE, MOVE_NOMONSTERS, self);
@@ -47,7 +48,7 @@
 		vecs_y = -vecs_y;
 	}
 	else
-		vecs = shotorg_adjust(vecs, TRUE, FALSE);
+		vecs = '0 0 0';
 
 	if(debug_shotorg != '0 0 0')
 		vecs = debug_shotorg;
@@ -381,27 +382,39 @@
 			makevectors(self.angles_x * '-1 0 0' + self.angles_y * '0 1 0' + self.angles_z * '0 0 1');
 			self.movedir = weapon_offset_x * v_forward - weapon_offset_y * v_right + weapon_offset_z * v_up + weapon_adjust;
 			self.movedir_x += 30;
+			self.spawnorigin = self.movedir;
 		}
 		else
 		{
+			self.origin = '0 0 0';
+			self.angles = '0 0 0';
+			self.frame = 0;
+			self.viewmodelforclient = world;
+
 			float idx;
 			idx = gettagindex(self, "shot");
-			if(!idx)
+			if(idx)
 			{
-				print("WARNING: the weapon ", self.model, " does not support the correct shot origin tag.\n");
-				idx = gettagindex(self, "bone02");
+				self.movedir = gettaginfo(self, idx);
 			}
+			else
+			{
+				print("WARNING: weapon model ", self.model, " does not support the 'shot' tag\n");
+				self.movedir = '0 0 0';
+			}
+
+			idx = gettagindex(self, "shell");
 			if(idx)
 			{
-				self.origin = '0 0 0';
-				self.angles = '0 0 0';
-				self.frame = 0;
-				self.viewmodelforclient = world;
-				self.movedir = gettaginfo(self, idx);
-				self.viewmodelforclient = self.owner;
+				self.spawnorigin = gettaginfo(self, idx);
 			}
 			else
-				self.movedir = '0 0 0';
+			{
+				print("WARNING: weapon model ", self.model, " does not support the 'shell' tag\n");
+				self.spawnorigin = self.movedir;
+			}
+
+			self.viewmodelforclient = self.owner;
 		}
 
 		self.view_ofs = '0 0 0';
@@ -414,6 +427,8 @@
 			self.view_ofs = shotorg_adjust(v0, FALSE, TRUE) - v0;
 		}
 
+		self.spawnorigin += self.view_ofs; // offset the casings origin by the same amount
+
 		// check if an instant weapon switch occurred
 		if (qcweaponanimation)
 		{

Modified: trunk/data/qcsrc/server/clientcommands.qc
===================================================================
--- trunk/data/qcsrc/server/clientcommands.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/clientcommands.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -319,18 +319,17 @@
 		else
 			sprint(self, "Usage: sv_cheats 1; restart; cmd pointparticles effectname position(0..1) velocityvector multiplier\n");
 	} else if(argv(0) == "trailparticles") {
-		if(sv_cheats && tokens == 3)
+		if(sv_cheats && tokens == 2)
 		{
 			// arguments:
 			//   effectname
-			//   shot origin vector
 			effectnum = particleeffectnum(argv(1));
-			W_SetupShot(self, stov(argv(2)), FALSE, FALSE, "");
+			W_SetupShot(self,  FALSE, FALSE, "");
 			traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self);
 			trailparticles(self, effectnum, w_shotorg, trace_endpos);
 		}
 		else
-			sprint(self, "Usage: sv_cheats 1; restart; cmd trailparticles effectname shotorigin\n");
+			sprint(self, "Usage: sv_cheats 1; restart; cmd trailparticles effectname\n");
 	} else {
 		//if(ctf_clientcommand())
 		//	return;

Modified: trunk/data/qcsrc/server/g_casings.qc
===================================================================
--- trunk/data/qcsrc/server/g_casings.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/g_casings.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -12,10 +12,13 @@
 	return TRUE;
 }
 
-void SpawnCasing(vector org, vector vel, float randomvel, vector ang, vector avel, float randomavel, float casingtype)
+void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, float casingtype)
 {
 	entity e;
+	vector org;
 
+	org = self.origin + self.weaponentity.spawnorigin_x * v_forward - self.weaponentity.spawnorigin_y * v_right + self.weaponentity.spawnorigin_z * v_up;
+
 	e = spawn();
 	e.state = casingtype;
 	e.origin = org;

Modified: trunk/data/qcsrc/server/w_campingrifle.qc
===================================================================
--- trunk/data/qcsrc/server/w_campingrifle.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_campingrifle.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -51,7 +51,7 @@
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_nails -= pAmmo;
 
-	W_SetupShot (self, '41 7 -10.5', FALSE, 2, "weapons/campingrifle_fire.wav");
+	W_SetupShot (self, FALSE, 2, "weapons/campingrifle_fire.wav");
 	pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
 
 	if(self.BUTTON_ZOOM) // if zoomed, shoot from the eye
@@ -63,7 +63,7 @@
 	fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, EF_RED, 1, pBulletConstant);
 
 	if (cvar("g_casings") >= 2)
-		SpawnCasing (w_shotorg - v_forward * 15, ((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3);
+		SpawnCasing (((random () * 50 - 100) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3);
 	
 	self.campingrifle_bulletcounter = self.campingrifle_bulletcounter + 1;
 }

Modified: trunk/data/qcsrc/server/w_crylink.qc
===================================================================
--- trunk/data/qcsrc/server/w_crylink.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_crylink.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -66,7 +66,7 @@
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo");
 
-	W_SetupShot (self, '23 8 -10', FALSE, 2, "weapons/crylink_fire.wav");
+	W_SetupShot (self, FALSE, 2, "weapons/crylink_fire.wav");
 	forward = v_forward;
 	right = v_right;
 	up = v_up;
@@ -132,7 +132,7 @@
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_secondary_ammo");
 
-	W_SetupShot (self, '25 8 -8', FALSE, 2, "weapons/crylink_fire2.wav");
+	W_SetupShot (self, FALSE, 2, "weapons/crylink_fire2.wav");
 
 	shots = cvar("g_balance_crylink_secondary_shots");
 	pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
@@ -180,7 +180,7 @@
 {
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_cells = self.ammo_cells - cvar("g_balance_crylink_primary_ammo");
-	W_SetupShot (self, '25 8 -8', TRUE, 0, "weapons/crylink_fire.wav");
+	W_SetupShot (self, TRUE, 0, "weapons/crylink_fire.wav");
 
 	traceline_antilag(self, w_shotorg, w_shotorg + w_shotdir * 1000, FALSE, self, self.ping * 0.001);
 

Modified: trunk/data/qcsrc/server/w_electro.qc
===================================================================
--- trunk/data/qcsrc/server/w_electro.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_electro.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -72,7 +72,7 @@
 {
 	local entity proj;
 
-	W_SetupShot (self, '24 8 -9.5', FALSE, 2, "weapons/electro_fire.wav");
+	W_SetupShot (self, FALSE, 2, "weapons/electro_fire.wav");
 
 	pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -107,7 +107,7 @@
 {
 	local entity proj;
 
-	W_SetupShot (self, '25 8 -8', FALSE, 2, "weapons/electro_fire2.wav");
+	W_SetupShot (self, FALSE, 2, "weapons/electro_fire2.wav");
 
 	pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 

Modified: trunk/data/qcsrc/server/w_grenadelauncher.qc
===================================================================
--- trunk/data/qcsrc/server/w_grenadelauncher.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_grenadelauncher.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -77,7 +77,7 @@
 
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_primary_ammo");
-	W_SetupShot (self, '24 8 -10', FALSE, 4, "weapons/grenade_fire.wav");
+	W_SetupShot (self, FALSE, 4, "weapons/grenade_fire.wav");
 
 	pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -110,8 +110,8 @@
 
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_secondary_ammo");
-	W_SetupShot (self, '25 6 -8', FALSE, 4, "weapons/grenade_fire.wav");
-	//W_SetupShot (self, '25 8 -8', FALSE, 4, "weapons/grenade_fire.wav"); // TODO: move model to the right a little
+	W_SetupShot (self, FALSE, 4, "weapons/grenade_fire.wav");
+	//W_SetupShot (self, FALSE, 4, "weapons/grenade_fire.wav"); // TODO: move model to the right a little
 
 	pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 

Modified: trunk/data/qcsrc/server/w_hagar.qc
===================================================================
--- trunk/data/qcsrc/server/w_hagar.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_hagar.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -51,7 +51,7 @@
 
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_primary_ammo");
-	W_SetupShot (self, '22 8 -10', FALSE, 2, "weapons/hagar_fire.wav");
+	W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav");
 
 	pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -88,8 +88,8 @@
 
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_rockets = self.ammo_rockets - cvar("g_balance_hagar_secondary_ammo");
-	W_SetupShot (self, '25 5 -8', FALSE, 2, "weapons/hagar_fire.wav");
-	//W_SetupShot (self, '25 8 -8', FALSE, 2, "weapons/hagar_fire.wav"); // TODO: move model a little to the right
+	W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav");
+	//W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav"); // TODO: move model a little to the right
 
 	pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 

Modified: trunk/data/qcsrc/server/w_hlac.qc
===================================================================
--- trunk/data/qcsrc/server/w_hlac.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_hlac.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -36,7 +36,7 @@
     if(self.crouch)
         spread = spread * cvar("g_balance_hlac_primary_spread_crouchmod");
 
-	W_SetupShot (self, '24 8 -11', FALSE, 3, "weapons/lasergun_fire.wav");
+	W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav");
 	pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 	if (!g_norecoil)
 	{
@@ -84,7 +84,7 @@
     if(self.crouch)
         spread = spread * cvar("g_balance_hlac_secondary_spread_crouchmod");
 
-	W_SetupShot (self, '25 8 -8', FALSE, 3, "weapons/lasergun_fire.wav");
+	W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav");
 	pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
 	missile = spawn ();

Modified: trunk/data/qcsrc/server/w_hook.qc
===================================================================
--- trunk/data/qcsrc/server/w_hook.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_hook.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -60,7 +60,7 @@
 
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_secondary_ammo");
-	W_SetupShot (self, '21 8 -8.5', FALSE, 4, "weapons/hookbomb_fire.wav");
+	W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav");
 
 	gren = spawn ();
 	gren.owner = self;

Modified: trunk/data/qcsrc/server/w_laser.qc
===================================================================
--- trunk/data/qcsrc/server/w_laser.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_laser.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -17,7 +17,7 @@
 {
 	local entity missile;
 
-	W_SetupShot (self, '21 8 -9', FALSE, 3, "weapons/lasergun_fire.wav");
+	W_SetupShot (self, FALSE, 3, "weapons/lasergun_fire.wav");
 	pointparticles(particleeffectnum("laser_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
 	missile = spawn ();

Modified: trunk/data/qcsrc/server/w_minstanex.qc
===================================================================
--- trunk/data/qcsrc/server/w_minstanex.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_minstanex.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -5,7 +5,7 @@
 	float flying;
 	flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
 
-	W_SetupShot (self, '25 8 -4', TRUE, 5, "weapons/minstanexfire.wav");
+	W_SetupShot (self, TRUE, 5, "weapons/minstanexfire.wav");
 
 	yoda = 0;
 	damage_goodhits = 0;

Modified: trunk/data/qcsrc/server/w_nex.qc
===================================================================
--- trunk/data/qcsrc/server/w_nex.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_nex.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -15,7 +15,7 @@
 	float flying;
 	flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
 
-	W_SetupShot (self, '33 8 -9', TRUE, 5, "weapons/nexfire.wav");
+	W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav");
 
 	yoda = 0;
 	FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), WEP_NEX);

Modified: trunk/data/qcsrc/server/w_porto.qc
===================================================================
--- trunk/data/qcsrc/server/w_porto.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_porto.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -156,7 +156,10 @@
 
 	if not(self.items & IT_UNLIMITED_SUPERWEAPONS)
 		self.weapons = self.weapons - (self.weapons & WEPBIT_PORTO);
-	W_SetupShot (self, '0 0 0', FALSE, 4, "porto/fire.wav");
+	W_SetupShot (self, FALSE, 4, "porto/fire.wav");
+	// always shoot from the eye
+	w_shotdir = v_forward;
+	w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
 
 	//pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 

Modified: trunk/data/qcsrc/server/w_rocketlauncher.qc
===================================================================
--- trunk/data/qcsrc/server/w_rocketlauncher.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_rocketlauncher.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -198,7 +198,7 @@
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_rockets = self.ammo_rockets - cvar("g_balance_rocketlauncher_ammo");
 
-	W_SetupShot (self, '27.0 8 -10.0', FALSE, 5, "weapons/rocket_fire.wav");
+	W_SetupShot (self, FALSE, 5, "weapons/rocket_fire.wav");
 	pointparticles(particleeffectnum("rocketlauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
 	missile = spawn ();
@@ -246,15 +246,7 @@
 	flash.customizeentityforclient = CL_Weaponentity_CustomizeEntityForClient;
 	setorigin (flash, '5 0 0');
 	setmodel (flash, "models/flash.md3"); // precision set below
-	if (gettagindex(self.weaponentity, "shot"))
-		setattachment(flash, self.weaponentity, "shot");
-	else if (gettagindex(self.weaponentity, "bone02"))
-		setattachment(flash, self.weaponentity, "bone02");
-	else
-	{
-		setorigin(flash, '27 0 5');
-		setattachment(flash, self.weaponentity, "");
-	}
+	setattachment(flash, self.weaponentity, "shot");
 	SUB_SetFade (flash, time, 0.1);
 
 	// muzzle flash for 3rd person view

Modified: trunk/data/qcsrc/server/w_seeker.qc
===================================================================
--- trunk/data/qcsrc/server/w_seeker.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_seeker.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -160,7 +160,7 @@
 		self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_missile_ammo");
 
 	makevectors(self.v_angle);
-	W_SetupShot (self, '38.75 13.25 -22', FALSE, 2, "weapons/seeker_fire.wav");
+	W_SetupShot (self, FALSE, 2, "weapons/seeker_fire.wav");
 	w_shotorg += f_diff;
 	pointparticles(particleeffectnum("seeker_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -312,7 +312,7 @@
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
 		self.ammo_rockets = self.ammo_rockets - cvar("g_balance_seeker_tag_ammo");
 
-	W_SetupShot (self, '38.75 13.25 -22', FALSE, 2, "weapons/tag_fire.wav");
+	W_SetupShot (self, FALSE, 2, "weapons/tag_fire.wav");
 
 	missile                 = spawn();
 	missile.owner           = self;
@@ -385,7 +385,7 @@
 			f_diff = '+1.25 +3.75 0';
 			break;
 	}
-	W_SetupShot (self, ''38.75 13.25 -22', FALSE, 2, "weapons/flac_fire.wav");
+	W_SetupShot (self, FALSE, 2, "weapons/flac_fire.wav");
 	w_shotorg += f_diff;
 
 	pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);

Modified: trunk/data/qcsrc/server/w_shotgun.qc
===================================================================
--- trunk/data/qcsrc/server/w_shotgun.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_shotgun.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -19,7 +19,7 @@
 	bulletspeed = cvar("g_balance_shotgun_primary_speed");
 	bulletconstant = cvar("g_balance_shotgun_primary_bulletconstant");
 
-	W_SetupShot (self, '28 8 -10', TRUE, 5, "weapons/shotgun_fire.wav");
+	W_SetupShot (self, TRUE, 5, "weapons/shotgun_fire.wav");
 	for (sc = 0;sc < bullets;sc = sc + 1)
 		fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN, 0, 1, bulletconstant);
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
@@ -30,21 +30,13 @@
 	// casing code
 	if (cvar("g_casings") >= 1)
 		for (sc = 0;sc < ammo;sc = sc + 1)
-			SpawnCasing (w_shotorg - v_forward * 10, ((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1);
+			SpawnCasing (((random () * 50 - 100) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1);
 
 	// muzzle flash for 1st person view
 	flash = spawn();
 	setorigin(flash, '5 0 0');
 	setmodel(flash, "models/uziflash.md3"); // precision set below
-	if (gettagindex(self.weaponentity, "shot"))
-		setattachment(flash, self.weaponentity, "shot");
-	else if (gettagindex(self.weaponentity, "bone02"))
-		setattachment(flash, self.weaponentity, "bone02");
-	else
-	{
-		setorigin(flash, '48 0 5');
-		setattachment(flash, self.weaponentity, "");
-	}
+	setattachment(flash, self.weaponentity, "shot");
 	flash.owner = self;
 	flash.viewmodelforclient = self;
 	flash.customizeentityforclient = CL_Weaponentity_CustomizeEntityForClient;
@@ -76,7 +68,7 @@
 	bulletspeed = cvar("g_balance_shotgun_secondary_speed");
 	bulletconstant = cvar("g_balance_shotgun_secondary_bulletconstant");
 
-	W_SetupShot (self, '25 8 -8', TRUE, 5, "weapons/shotgun_fire.wav");
+	W_SetupShot (self, TRUE, 5, "weapons/shotgun_fire.wav");
 	for (sc = 0;sc < bullets;sc = sc + 1)
 		fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN | HITTYPE_SECONDARY, 0, 1, bulletconstant);
 	if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
@@ -87,20 +79,12 @@
 	// casing code
 	if (cvar("g_casings") >= 1)
 		for (sc = 0;sc < ammo;sc = sc + 1)
-			SpawnCasing (w_shotorg - v_forward * 10, ((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1);
+			SpawnCasing (((random () * 50 - 100) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 30) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 1);
 
 	flash = spawn();
 	setorigin(flash, '5 0 0');
 	setmodel(flash, "models/uziflash.md3"); // precision set below
-	if (gettagindex(self.weaponentity, "shot"))
-		setattachment(flash, self.weaponentity, "shot");
-	else if (gettagindex(self.weaponentity, "bone02"))
-		setattachment(flash, self.weaponentity, "bone02");
-	else
-	{
-		setorigin(flash, '48 0 5');
-		setattachment(flash, self.weaponentity, "");
-	}
+	setattachment(flash, self.weaponentity, "shot");
 	flash.owner = self;
 	flash.viewmodelforclient = self;
 	flash.customizeentityforclient = CL_Weaponentity_CustomizeEntityForClient;

Modified: trunk/data/qcsrc/server/w_uzi.qc
===================================================================
--- trunk/data/qcsrc/server/w_uzi.qc	2009-03-15 10:19:49 UTC (rev 6174)
+++ trunk/data/qcsrc/server/w_uzi.qc	2009-03-15 10:41:13 UTC (rev 6175)
@@ -22,7 +22,7 @@
 		else
 			self.ammo_nails = self.ammo_nails - cvar("g_balance_uzi_sustained_ammo");
 	}
-	W_SetupShot (self, '23 8 -9.5', TRUE, 0, "weapons/uzi_fire.wav");
+	W_SetupShot (self, TRUE, 0, "weapons/uzi_fire.wav");
 	if (!g_norecoil)
 	{
 		self.punchangle_x = random () - 0.5;
@@ -43,17 +43,7 @@
 	flash = spawn();
 	setorigin(flash, '5 0 0');
 	setmodel(flash, "models/uziflash.md3"); // precision set below
-	if (gettagindex(self.weaponentity, "shot"))
-		setattachment(flash, self.weaponentity, "shot");
-	else if (gettagindex(self.weaponentity, "bone02"))
-		setattachment(flash, self.weaponentity, "bone02");
-	else
-	{
-		setorigin(flash, shotorg + shotdir * 50);
-		flash.angles = vectoangles(shotdir);
-		//setorigin(flash, '48 0 5');
-		//setattachment(flash, self.weaponentity, "");
-	}
+	setattachment(flash, self.weaponentity, "shot");
 	flash.owner = self;
 	flash.viewmodelforclient = self;
 	flash.customizeentityforclient = CL_Weaponentity_CustomizeEntityForClient;
@@ -78,7 +68,7 @@
 
 	// casing code
 	if (cvar("g_casings") >= 2)
-		SpawnCasing (w_shotorg - v_forward * 10, ((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3);
+		SpawnCasing (((random () * 50 - 100) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3);
 }
 
 // weapon frames



More information about the nexuiz-commits mailing list