]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix CSQC view entity handling
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 4 Dec 2011 13:40:41 +0000 (13:40 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 4 Dec 2011 13:40:41 +0000 (13:40 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11594 d7cf8633-e32d-0410-b094-e92efae38249

csprogs.c

index 726768b6e6c2daa527985d31733b0f3cf38634ca..9046b2bed5cf6fa65372c73b699ae8a26bdc57d5 100644 (file)
--- 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;
 }