r1732 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Jul 7 12:24:51 EDT 2006


Author: div0
Date: 2006-07-07 12:24:50 -0400 (Fri, 07 Jul 2006)
New Revision: 1732

Modified:
   trunk/data/qcsrc/server/cl_weaponsystem.qc
   trunk/data/qcsrc/server/miscfunctions.qc
Log:
made the (hopefully never occurring) debugging error() call in the weapon system non-fatal


Modified: trunk/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weaponsystem.qc	2006-07-07 16:04:32 UTC (rev 1731)
+++ trunk/data/qcsrc/server/cl_weaponsystem.qc	2006-07-07 16:24:50 UTC (rev 1732)
@@ -380,7 +380,7 @@
 
 	if(self.weapon_think == w_ready && func != w_ready && self.weaponentity.state == WS_RAISE)
 	{
-		error("Tried to override initial weapon think function - should this really happen?\n");
+		backtrace("Tried to override initial weapon think function - should this really happen?");
 	}
 
 	if(cvar("g_runematch"))

Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc	2006-07-07 16:04:32 UTC (rev 1731)
+++ trunk/data/qcsrc/server/miscfunctions.qc	2006-07-07 16:24:50 UTC (rev 1732)
@@ -408,3 +408,17 @@
 	fclose(fh);
 	return TRUE;
 }
+
+void backtrace(string msg)
+{
+	float dev;
+	dev = cvar("developer");
+	cvar_set("developer", "1");
+	dprint("\n");
+	dprint("--- CUT HERE ---\nWARNING: ");
+	dprint(msg);
+	dprint("\n");
+	remove(world); // isn't there any better way to cause a backtrace?
+	dprint("\n--- CUT UNTIL HERE ---\n");
+	cvar_set("developer", ftos(dev));
+}




More information about the nexuiz-commits mailing list