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

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Sep 20 05:26:43 EDT 2009


Author: div0
Date: 2009-09-20 05:26:43 -0400 (Sun, 20 Sep 2009)
New Revision: 7844

Modified:
   trunk/data/qcsrc/server/cl_weapons.qc
Log:
save/restore v_forward when calling weapon think functions (fixes mikeeusa's "Crylink fires two streams" bug)


Modified: trunk/data/qcsrc/server/cl_weapons.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weapons.qc	2009-09-20 05:04:34 UTC (rev 7843)
+++ trunk/data/qcsrc/server/cl_weapons.qc	2009-09-20 09:26:43 UTC (rev 7844)
@@ -297,6 +297,8 @@
 // Bringed back weapon frame
 void W_WeaponFrame()
 {
+	vector fo, ri, up;
+
 	if((arena_roundbased && time < warmup) || ((time < game_starttime) && !cvar("sv_ready_restart_after_countdown")))
 		return;
 
@@ -313,6 +315,9 @@
 	}
 
 	makevectors(self.v_angle);
+	fo = v_forward; // save them in case the weapon think functions change it
+	ri = v_right;
+	up = v_up;
 
 	// Change weapon
 	if (self.weapon != self.switchweapon)
@@ -362,11 +367,21 @@
 			wb = 0;
 		}
 		if(wb)
+		{
+			v_forward = fo;
+			v_right = ri;
+			v_up = up;
 			weapon_action(self.weapon, WR_THINK);
+		}
 		if (time + frametime * 0.5 >= self.weapon_nextthink)
 		{
 			if(self.weapon_think)
+			{
+				v_forward = fo;
+				v_right = ri;
+				v_up = up;
 				self.weapon_think();
+			}
 			else
 				bprint("\{1}^1ERROR: undefined weapon think function for ", self.netname, "\n");
 		}



More information about the nexuiz-commits mailing list