GAME_NEXUIZ: skip player entities in hitnetworkplayers if they have -666 (spectator...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 18 Jan 2009 19:10:25 +0000 (19:10 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 18 Jan 2009 19:10:25 +0000 (19:10 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8657 d7cf8633-e32d-0410-b094-e92efae38249

cl_collision.c

index 10e8f4c..09e9349 100644 (file)
@@ -317,15 +317,33 @@ trace_t CL_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const
        {
                vec3_t origin, entmins, entmaxs;
                matrix4x4_t entmatrix, entinversematrix;
+
+               if(gamemode == GAME_NEXUIZ)
+               {
+                       // don't hit network players, if we are a nonsolid player
+                       if(cl.scores[cl.playerentity-1].frags == -666 || cl.scores[cl.playerentity-1].frags == -616)
+                               goto skipnetworkplayers;
+               }
+
                for (i = 1;i <= cl.maxclients;i++)
                {
                        entity_render_t *ent = &cl.entities[i].render;
-                       // don't hit players that don't exist
-                       if (!cl.scores[i-1].name[0])
-                               continue;
+
                        // don't hit ourselves
                        if (i == cl.playerentity)
                                continue;
+
+                       // don't hit players that don't exist
+                       if (!cl.scores[i-1].name[0])
+                               continue;
+
+                       if(gamemode == GAME_NEXUIZ)
+                       {
+                               // don't hit spectators or nonsolid players
+                               if(cl.scores[i-1].frags == -666 || cl.scores[i-1].frags == -616)
+                                       continue;
+                       }
+
                        Matrix4x4_OriginFromMatrix(&ent->matrix, origin);
                        VectorAdd(origin, cl.playerstandmins, entmins);
                        VectorAdd(origin, cl.playerstandmaxs, entmaxs);
@@ -338,6 +356,9 @@ trace_t CL_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const
                                *hitnetworkentity = i;
                        Collision_CombineTraces(&cliptrace, &trace, NULL, false);
                }
+
+skipnetworkplayers:
+               ;
        }
 
        // clip to entities