From 36db1374c6782cadb439e5d642e0ffed73236034 Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 7 Nov 2009 13:01:47 +0000 Subject: [PATCH] more stupid error code passing git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9451 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_main.c | 2 +- clvm_cmds.c | 11 +++++------ csprogs.h | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/cl_main.c b/cl_main.c index c369a436..58241741 100644 --- a/cl_main.c +++ b/cl_main.c @@ -920,7 +920,7 @@ void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolat // 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); diff --git a/clvm_cmds.c b/clvm_cmds.c index 0e408f4f..fc0ad585 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -2276,6 +2276,7 @@ void CL_GetEntityMatrix (prvm_edict_t *ent, matrix4x4_t *out, qboolean viewmatri 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 @@ -2291,15 +2292,13 @@ int CL_GetEntityLocalTagMatrix(prvm_edict_t *ent, int tagindex, matrix4x4_t *out 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: diff --git a/csprogs.h b/csprogs.h index 1cd41deb..e930132e 100644 --- a/csprogs.h +++ b/csprogs.h @@ -62,6 +62,6 @@ qboolean MakeDownloadPacket(const char *filename, unsigned char *data, unsigned 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 -- 2.39.2