]> 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 1ee20b6017214c909f87ed829bfae821e742a7f0..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
 
 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[] =
 {
@@ -281,7 +294,7 @@ qboolean CL_VM_InputEvent (qboolean down, int key, int ascii)
                        PRVM_G_FLOAT(OFS_PARM1) = key;
                        PRVM_G_FLOAT(OFS_PARM2) = ascii;
                        PRVM_ExecuteProgram(prog->funcoffsets.CSQC_InputEvent, "QC function CSQC_InputEvent is missing");
-                       r = CSQC_RETURNVAL;
+                       r = CSQC_RETURNVAL != 0;
                }
        CSQC_END
        return r;
@@ -332,7 +345,7 @@ qboolean CL_VM_ConsoleCommand (const char *cmd)
                PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(cmd);
                PRVM_ExecuteProgram(prog->funcoffsets.CSQC_ConsoleCommand, "QC function CSQC_ConsoleCommand is missing");
                vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
-               r = CSQC_RETURNVAL;
+               r = CSQC_RETURNVAL != 0;
        }
        CSQC_END
        return r;
@@ -351,7 +364,7 @@ qboolean CL_VM_Parse_TempEntity (void)
                prog->globals.client->time = cl.time;
                prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity];
                PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Parse_TempEntity, "QC function CSQC_Parse_TempEntity is missing");
-               r = CSQC_RETURNVAL;
+               r = CSQC_RETURNVAL != 0;
                if(!r)
                {
                        msg_readcount = t;
@@ -550,7 +563,7 @@ qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float atten
                        PRVM_G_FLOAT(OFS_PARM4) = attenuation;
                        VectorCopy(pos, PRVM_G_VECTOR(OFS_PARM5) );
                        PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Event_Sound, "QC function CSQC_Event_Sound is missing");
-                       r = CSQC_RETURNVAL;
+                       r = CSQC_RETURNVAL != 0;
                }
                CSQC_END
        }