]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - csprogs.c
make getsurface* not animate vertices if the model is not animated
[xonotic/darkplaces.git] / csprogs.c
index bdb0e48561ac52d54ddbfa2b7f00fee9e7bf8da6..33f2987f5b1f72cea8a45ee3d26d2f43affc787e 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -30,7 +30,7 @@ void CL_VM_PreventInformationLeaks(void)
 }
 
 //[515]: these are required funcs
-static char *cl_required_func[] =
+static const char *cl_required_func[] =
 {
        "CSQC_Init",
        "CSQC_InputEvent",
@@ -123,6 +123,10 @@ static void CSQC_SetGlobals (void)
 
                if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.view_angles)))
                        VectorCopy(cl.viewangles, val->vector);
+               if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.view_punchangle)))
+                       VectorCopy(cl.punchangle, val->vector);
+               if ((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.view_punchvector)))
+                       VectorCopy(cl.punchvector, val->vector);
                prog->globals.client->maxclients = cl.maxclients;
        CSQC_END
 }
@@ -190,6 +194,11 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
                        return false;
        }
 
+       if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.userwavefunc_param0)))    entrender->userwavefunc_param[0] = val->_float;
+       if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.userwavefunc_param1)))    entrender->userwavefunc_param[1] = val->_float;
+       if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.userwavefunc_param2)))    entrender->userwavefunc_param[2] = val->_float;
+       if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.userwavefunc_param3)))    entrender->userwavefunc_param[3] = val->_float;
+
        entrender->model = model;
        entrender->skinnum = (int)ed->fields.client->skin;
        entrender->effects |= entrender->model->effects;
@@ -200,7 +209,7 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.scale)) && val->_float)           entrender->scale = scale = val->_float;
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.colormod)) && VectorLength2(val->vector)) VectorCopy(val->vector, entrender->colormod);
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.glowmod)) && VectorLength2(val->vector))  VectorCopy(val->vector, entrender->glowmod);
-       if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.effects)) && val->_float) entrender->effects |= (int)val->_float;
+       if(ed->fields.client->effects)  entrender->effects |= (int)ed->fields.client->effects;
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.tag_entity)) && val->edict)
        {
                int tagentity;
@@ -976,13 +985,13 @@ void CL_VM_Init (void)
        prog->globals.client->time = cl.time;
        prog->globals.client->self = 0;
 
-       prog->globals.client->mapname = cl.worldmodel ? PRVM_SetEngineString(cl.worldmodel->name) : PRVM_SetEngineString("");
+       prog->globals.client->mapname = PRVM_SetEngineString(cl.worldname);
        prog->globals.client->player_localentnum = cl.playerentity;
 
        // set map description (use world entity 0)
        val = PRVM_EDICTFIELDVALUE(prog->edicts, prog->fieldoffsets.message);
        if(val)
-               val->string = PRVM_SetEngineString(cl.levelname);
+               val->string = PRVM_SetEngineString(cl.worldmessage);
        VectorCopy(cl.world.mins, prog->edicts->fields.client->mins);
        VectorCopy(cl.world.maxs, prog->edicts->fields.client->maxs);