]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix RF_VIEWMODEL by using CL_GetTagMatrix on self rather than
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 8 May 2011 12:56:22 +0000 (12:56 +0000)
committerRudolf Polzer <divVerent@xonotic.org>
Mon, 9 May 2011 08:41:06 +0000 (10:41 +0200)
self.tag_entity

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11121 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=6b9d903de3ec0ac28f43f18e2df4ab7b09cbf1d5

csprogs.c

index 33f2987f5b1f72cea8a45ee3d26d2f43affc787e..88600c3977e4d5f81b4010c62b7f52be61bdb087 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -210,22 +210,13 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.colormod)) && VectorLength2(val->vector)) VectorCopy(val->vector, entrender->colormod);
        if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.glowmod)) && VectorLength2(val->vector))  VectorCopy(val->vector, entrender->glowmod);
        if(ed->fields.client->effects)  entrender->effects |= (int)ed->fields.client->effects;
-       if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.tag_entity)) && val->edict)
-       {
-               int tagentity;
-               int tagindex = 0;
-               tagentity = val->edict;
-               if((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.tag_index)) && val->_float)
-                       tagindex = (int)val->_float;
-               CL_GetTagMatrix (&tagmatrix, PRVM_PROG_TO_EDICT(tagentity), tagindex);
-       }
-       else
-               Matrix4x4_CreateIdentity(&tagmatrix);
        if (!VectorLength2(entrender->colormod))
                VectorSet(entrender->colormod, 1, 1, 1);
        if (!VectorLength2(entrender->glowmod))
                VectorSet(entrender->glowmod, 1, 1, 1);
 
+       // LordHavoc: use the CL_GetTagMatrix function on self to ensure consistent behavior (duplicate code would be bad)
+       CL_GetTagMatrix(&tagmatrix, ed, 0);
        if (renderflags & RF_USEAXIS)
        {
                vec3_t left;