From: divverent Date: Sun, 4 Dec 2011 13:40:41 +0000 (+0000) Subject: fix CSQC view entity handling X-Git-Tag: xonotic-v0.6.0~128 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1168e3379670e720929e0edc7ce1c90a4d32db6b;p=xonotic%2Fdarkplaces.git 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 --- 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; }