From: Samual Lenks Date: Tue, 5 Feb 2013 03:23:13 +0000 (-0500) Subject: Saved for gmqcc internal error X-Git-Tag: xonotic-v0.7.0~62^2~23^2~277 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f8ae5c12c52bbaf38e7137335c1d227712b4eda9;p=xonotic%2Fxonotic-data.pk3dir.git Saved for gmqcc internal error --- diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 8e3f81f5a7..0cc53bd33c 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -2505,3 +2505,28 @@ float Count_Proper_Floats(float improper, float...count) return total; } + +// todo: this sucks, lets find a better way to do backtraces? +#ifndef MENUQC +void backtrace(string msg) +{ + float dev, war; + #ifdef SVQC + dev = autocvar_developer; + war = autocvar_prvm_backtraceforwarnings; + #else + dev = cvar("developer"); + war = cvar("prvm_backtraceforwarnings"); + #endif + cvar_set("developer", "1"); + cvar_set("prvm_backtraceforwarnings", "1"); + print("\n"); + print("--- CUT HERE ---\nWARNING: "); + print(msg); + print("\n"); + remove(world); // isn't there any better way to cause a backtrace? + print("\n--- CUT UNTIL HERE ---\n"); + cvar_set("developer", ftos(dev)); + cvar_set("prvm_backtraceforwarnings", ftos(war)); +} +#endif diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index a58438f0d8..263d7f8229 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -378,3 +378,5 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t float Count_Proper_Strings(string improper, string...count); float Count_Proper_Floats(float improper, float...count); + +void backtrace(string msg); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index cc96c58473..9965d5232e 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -593,23 +593,6 @@ void GetCvars(float f) } } -void backtrace(string msg) -{ - float dev, war; - dev = autocvar_developer; - war = autocvar_prvm_backtraceforwarnings; - cvar_set("developer", "1"); - cvar_set("prvm_backtraceforwarnings", "1"); - print("\n"); - print("--- CUT HERE ---\nWARNING: "); - print(msg); - print("\n"); - remove(world); // isn't there any better way to cause a backtrace? - print("\n--- CUT UNTIL HERE ---\n"); - cvar_set("developer", ftos(dev)); - cvar_set("prvm_backtraceforwarnings", ftos(war)); -} - // decolorizes and team colors the player name when needed string playername(entity p) {