From: divverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Sat, 7 Nov 2009 13:01:47 +0000 (+0000)
Subject: more stupid error code passing
X-Git-Tag: xonotic-v0.1.0preview~1191
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=36db1374c6782cadb439e5d642e0ffed73236034;p=xonotic%2Fdarkplaces.git

more stupid error code passing


git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9451 d7cf8633-e32d-0410-b094-e92efae38249
---

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