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
*/
// 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;
}
float scale;
entity_render_t *entrender;
dp_model_t *model;
+ prvm_vec3_t modellight_origin;
model = CL_GetModelFromEdict(ed);
if (!model)
// 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);