Fix two pieces of code that did not compile with PRVM_64.
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 14 Apr 2018 05:11:44 +0000 (05:11 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 14 Apr 2018 05:11:44 +0000 (05:11 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12394 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
csprogs.c

index 34baa67..4734484 100644 (file)
@@ -2446,12 +2446,13 @@ static int CL_GetEntityLocalTagMatrix(prvm_prog_t *prog, prvm_edict_t *ent, int
 extern cvar_t cl_bob;
 extern cvar_t cl_bobcycle;
 extern cvar_t cl_bobup;
-int CL_GetTagMatrix (prvm_prog_t *prog, matrix4x4_t *out, prvm_edict_t *ent, int tagindex, prvm_vec_t *shadingorigin)
+int CL_GetTagMatrix (prvm_prog_t *prog, matrix4x4_t *out, prvm_edict_t *ent, int tagindex, prvm_vec_t *returnshadingorigin)
 {
        int ret;
        int attachloop;
        matrix4x4_t entitymatrix, tagmatrix, attachmatrix;
        dp_model_t *model;
+       vec3_t shadingorigin;
 
        *out = identitymatrix; // warnings and errors return identical matrix
 
@@ -2521,15 +2522,15 @@ int CL_GetTagMatrix (prvm_prog_t *prog, matrix4x4_t *out, prvm_edict_t *ent, int
                */
 
                // return the origin of the view
-               if (shadingorigin)
-                       Matrix4x4_OriginFromMatrix(&r_refdef.view.matrix, shadingorigin);
+               Matrix4x4_OriginFromMatrix(&r_refdef.view.matrix, shadingorigin);
        }
        else
        {
                // return the origin of the root entity in the chain
-               if (shadingorigin)
-                       Matrix4x4_OriginFromMatrix(out, shadingorigin);
+               Matrix4x4_OriginFromMatrix(out, shadingorigin);
        }
+       if (returnshadingorigin)
+               VectorCopy(shadingorigin, returnshadingorigin);
        return 0;
 }
 
index 8d54fc0..3e609ea 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -295,6 +295,7 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
        float scale;
        entity_render_t *entrender;
        dp_model_t *model;
+       prvm_vec3_t modellight_origin;
 
        model = CL_GetModelFromEdict(ed);
        if (!model)
@@ -348,7 +349,8 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
 
        // LadyHavoc: use the CL_GetTagMatrix function on self to ensure consistent behavior (duplicate code would be bad)
        // this also sets the custommodellight_origin for us
-       CL_GetTagMatrix(prog, &entrender->matrix, ed, 0, entrender->custommodellight_origin);
+       VectorCopy(modellight_origin, entrender->custommodellight_origin);
+       CL_GetTagMatrix(prog, &entrender->matrix, ed, 0, modellight_origin);
 
        // set up the animation data
        VM_GenerateFrameGroupBlend(prog, ed->priv.server->framegroupblend, ed);