From e8afb177dfb3405ce4da1e9dd61277c8b8774568 Mon Sep 17 00:00:00 2001 From: divverent Date: Fri, 2 Dec 2011 10:30:00 +0000 Subject: [PATCH] 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 --- csprogs.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) 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) -- 2.39.2