more stupid error code passing
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 7 Nov 2009 13:01:47 +0000 (13:01 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 7 Nov 2009 13:01:47 +0000 (13:01 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9451 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c
clvm_cmds.c
csprogs.h

index c369a43..5824174 100644 (file)
--- 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);
index 0e408f4..fc0ad58 100644 (file)
@@ -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:
index 1cd41de..e930132 100644 (file)
--- 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