// FIXME: use a model function to get tag info (need to handle skeletal)
if (e->state_current.tagentity && e->state_current.tagindex >= 1)
{
- if(CL_BlendTagMatrix(&t->render, e->state_current.tagindex - 1, &blendmatrix))
+ if(!CL_BlendTagMatrix(&t->render, e->state_current.tagindex - 1, &blendmatrix)) // i.e. no error
{
// concat the tag matrices onto the entity matrix
Matrix4x4_Concat(&tempmatrix, &t->render.matrix, &blendmatrix);
int CL_GetEntityLocalTagMatrix(prvm_edict_t *ent, int tagindex, matrix4x4_t *out)
{
int frame;
+ int ret;
dp_model_t *model;
entity_render_t cheatentity;
if (tagindex >= 0
cheatentity.model = model;
CL_LoadFrameGroupBlend(ent, &cheatentity);
R_LerpAnimation(&cheatentity);
- if(!CL_BlendTagMatrix(&cheatentity, tagindex, out))
- {
+ ret = CL_BlendTagMatrix(&cheatentity, tagindex, out);
+ if(ret)
*out = identitymatrix;
- return false;
- }
- return true;
+ return ret;
}
*out = identitymatrix;
- return false;
+ return 0;
}
// Warnings/errors code:
qboolean CL_VM_GetEntitySoundOrigin(int entnum, vec3_t out);
void CL_LoadFrameGroupBlend(prvm_edict_t *ed, entity_render_t *entrender);
-qboolean CL_BlendTagMatrix(entity_render_t *entrender, int tagindex, matrix4x4_t *blendmatrix);
+int CL_BlendTagMatrix(entity_render_t *entrender, int tagindex, matrix5x4_t *blendmatrix); // returns 0 or an error code
#endif