From 1168e3379670e720929e0edc7ce1c90a4d32db6b Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 4 Dec 2011 13:40:41 +0000 Subject: [PATCH] fix CSQC view entity handling git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11594 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=eb840a4901b003cbc56bab5878a391b38812fee6 --- csprogs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csprogs.c b/csprogs.c index 726768b6..9046b2be 100644 --- a/csprogs.c +++ b/csprogs.c @@ -376,13 +376,13 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed, int edictnum) // walk attachments to find RENDER_EXTERIORMODEL status { prvm_edict_t *ent = ed; - prvm_edict_t *v = PRVM_EDICT_NUM(CL_VM_GetViewEntity()); + int vn = CL_VM_GetViewEntity(); int attachloop = 0; for(;;) { if(attachloop >= 256) break; - if(ent == v) + if(MAX_EDICTS + PRVM_NUM_FOR_EDICT(ent) == vn) { entrender->flags |= RENDER_EXTERIORMODEL; break; @@ -1249,6 +1249,6 @@ qboolean CL_VM_TransformView(int entnum, matrix4x4_t *viewmatrix, mplane_t *clip int CL_VM_GetViewEntity(void) { if(cl.csqc_server2csqcentitynumber[cl.viewentity]) - return cl.csqc_server2csqcentitynumber[cl.viewentity]; + return cl.csqc_server2csqcentitynumber[cl.viewentity] + MAX_EDICTS; return cl.viewentity; } -- 2.39.2