]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
CSQC: propagate automatic RENDER_EXTERIORMODEL inherited from local player ent
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 2 Dec 2011 10:30:00 +0000 (10:30 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 3 Dec 2011 08:53:51 +0000 (09:53 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11587 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=e8afb177dfb3405ce4da1e9dd61277c8b8774568

csprogs.c

index 5816a3c6f0b7a687d9854220fca0c258465bbe66..726768b6e6c2daa527985d31733b0f3cf38634ca 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -373,8 +373,27 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum)
                if(renderflags & RF_ADDITIVE) entrender->flags |= RENDER_ADDITIVE;
        }
 
-       if(edictnum == CL_VM_GetViewEntity())
-               entrender->flags |= RENDER_EXTERIORMODEL;
+       // walk attachments to find RENDER_EXTERIORMODEL status
+       {
+               prvm_edict_t *ent = ed;
+               prvm_edict_t *v = PRVM_EDICT_NUM(CL_VM_GetViewEntity());
+               int attachloop = 0;
+               for(;;)
+               {
+                       if(attachloop >= 256)
+                               break;
+                       if(ent == v)
+                       {
+                               entrender->flags |= RENDER_EXTERIORMODEL;
+                               break;
+                       }
+                       if (PRVM_clientedictedict(ent, tag_entity))
+                               ent = PRVM_EDICT_NUM(PRVM_clientedictedict(ent, tag_entity));
+                       else
+                               break;
+                       attachloop++;
+               }
+       }
 
        c = (int)PRVM_clientedictfloat(ed, colormap);
        if (c <= 0)