From 7e8a101c81015e0bdab9fd78704f38f39d5a8ffe Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 14 Apr 2018 05:11:44 +0000 Subject: [PATCH] Fix two pieces of code that did not compile with PRVM_64. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12394 d7cf8633-e32d-0410-b094-e92efae38249 --- clvm_cmds.c | 11 ++++++----- csprogs.c | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/clvm_cmds.c b/clvm_cmds.c index 34baa67a..47344845 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -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; } diff --git a/csprogs.c b/csprogs.c index 8d54fc0f..3e609ea8 100644 --- 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); -- 2.39.2