From: divverent Date: Fri, 2 Dec 2011 10:30:00 +0000 (+0000) Subject: CSQC: propagate automatic RENDER_EXTERIORMODEL inherited from local player ent X-Git-Tag: xonotic-v0.6.0~102^2~32 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e8afb177dfb3405ce4da1e9dd61277c8b8774568;p=xonotic%2Fdarkplaces.git CSQC: propagate automatic RENDER_EXTERIORMODEL inherited from local player ent git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11587 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/csprogs.c b/csprogs.c index 5816a3c6..726768b6 100644 --- 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)