]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - csprogs.c
default to using texture rectangle shadowmaps when available
[xonotic/darkplaces.git] / csprogs.c
index 56b23ce7c86c3a9d635808e073425f4ec3e2cd0e..003eab4cd4061e3dc2d918d1cf93de9ff248c2b5 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -5,6 +5,7 @@
 #include "cl_collision.h"
 #include "snd_main.h"
 #include "clvm_cmds.h"
+#include "prvm_cmds.h"
 
 //============================================================================
 // Client prog handling
 
 #define CSQC_RETURNVAL prog->globals.generic[OFS_RETURN]
 #define CSQC_BEGIN             csqc_tmpprog=prog;prog=0;PRVM_SetProg(PRVM_CLIENTPROG);
-#define CSQC_END               VM_ClearTraceGlobals(); prog=csqc_tmpprog;
-// TODO check if the clearing of trace globals takes too much CPU. If it does,
-// perform it before console command processing instead.
+#define CSQC_END               prog=csqc_tmpprog;
 
 static prvm_prog_t *csqc_tmpprog;
 
+void CL_VM_PreventInformationLeaks(void)
+{
+       prvm_eval_t *val;
+       if(!cl.csqc_loaded)
+               return;
+       CSQC_BEGIN
+               VM_ClearTraceGlobals();
+               if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.trace_networkentity)))
+                       val->_float = 0;
+       CSQC_END
+}
+
 //[515]: these are required funcs
 static char *cl_required_func[] =
 {