r5171 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Dec 7 13:11:36 EST 2008


Author: div0
Date: 2008-12-07 13:11:36 -0500 (Sun, 07 Dec 2008)
New Revision: 5171

Modified:
   trunk/data/qcsrc/server/cl_weapons.qc
Log:
don't crash if weapon think function is not set


Modified: trunk/data/qcsrc/server/cl_weapons.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weapons.qc	2008-12-07 08:12:12 UTC (rev 5170)
+++ trunk/data/qcsrc/server/cl_weapons.qc	2008-12-07 18:11:36 UTC (rev 5171)
@@ -316,7 +316,12 @@
 		if(wb)
 			weapon_action(self.weapon, WR_THINK);
 		if (time + frametime * 0.5 >= self.weapon_nextthink)
-			self.weapon_think();
+		{
+			if(self.weapon_think)
+				self.weapon_think();
+			else
+				bprint("\{1}^1ERROR: undefined weapon think function for ", self.netname, "\n");
+		}
 	}
 
 	// don't let attack_finished fall behind when not firing (must be after weapon_setup calls!)




More information about the nexuiz-commits mailing list