]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
cleaned up order of bbox checks (whether to use the normal mins/maxs, or the clipmins...
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 10 Jun 2002 21:42:18 +0000 (21:42 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 10 Jun 2002 21:42:18 +0000 (21:42 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1942 d7cf8633-e32d-0410-b094-e92efae38249

sv_main.c
world.c

index fb24afd7093155931eaa732b151ce5e0e4874fdf..980e14f3c78666d717c07c518a5c6bc5c36ae0b6 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -36,6 +36,7 @@ static mempool_t *sv_edicts_mempool = NULL;
 //============================================================================
 
 extern void SV_Phys_Init (void);
+extern void SV_World_Init (void);
 
 /*
 ===============
@@ -64,6 +65,7 @@ void SV_Init (void)
        Cvar_RegisterVariable (&sv_cullentities_stats);
 
        SV_Phys_Init();
+       SV_World_Init();
 
        for (i = 0;i < MAX_MODELS;i++)
                sprintf (localmodels[i], "*%i", i);
diff --git a/world.c b/world.c
index 31dddb51ebd6a9c5116f9c487065a8a92580785a..5f2e20fddf3f3c615d73695c8717a63de2dc6983 100644 (file)
--- a/world.c
+++ b/world.c
@@ -29,6 +29,13 @@ line of sight checks trace->crosscontent, but bullets don't
 
 */
 
+cvar_t sv_useareanodes = {CVAR_NOTIFY, "sv_useareanodes", "1"};
+
+void SV_World_Init(void)
+{
+       Cvar_RegisterVariable(&sv_useareanodes);
+}
+
 
 void ClearLink (link_t *l);
 void RemoveLink (link_t *l);
@@ -500,10 +507,10 @@ loc0:
                }
 
                // might interact, so do an exact clip
-               if ((int)touch->v.flags & FL_MONSTER)
-                       trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins2, clip->maxs2, clip->end);
-               else if (touch->v.solid == SOLID_BSP)
+               if (touch->v.solid == SOLID_BSP)
                        trace = SV_ClipMoveToEntity (touch, clip->start, clip->hullmins, clip->hullmaxs, clip->end);
+               else if ((int)touch->v.flags & FL_MONSTER)
+                       trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins2, clip->maxs2, clip->end);
                else
                        trace = SV_ClipMoveToEntity (touch, clip->start, clip->mins, clip->maxs, clip->end);
                // LordHavoc: take the 'best' answers from the new trace and combine with existing data
@@ -555,27 +562,30 @@ SV_MoveBounds
 */
 void SV_MoveBounds (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, vec3_t boxmins, vec3_t boxmaxs)
 {
-#if 0
-// debug to test against everything
-boxmins[0] = boxmins[1] = boxmins[2] = -999999999;
-boxmaxs[0] = boxmaxs[1] = boxmaxs[2] =  999999999;
-#else
-       int             i;
-
-       for (i=0 ; i<3 ; i++)
+       if (sv_useareanodes.integer)
        {
-               if (end[i] > start[i])
-               {
-                       boxmins[i] = start[i] + mins[i] - 1;
-                       boxmaxs[i] = end[i] + maxs[i] + 1;
-               }
-               else
+               int i;
+
+               for (i=0 ; i<3 ; i++)
                {
-                       boxmins[i] = end[i] + mins[i] - 1;
-                       boxmaxs[i] = start[i] + maxs[i] + 1;
+                       if (end[i] > start[i])
+                       {
+                               boxmins[i] = start[i] + mins[i] - 1;
+                               boxmaxs[i] = end[i] + maxs[i] + 1;
+                       }
+                       else
+                       {
+                               boxmins[i] = end[i] + mins[i] - 1;
+                               boxmaxs[i] = start[i] + maxs[i] + 1;
+                       }
                }
        }
-#endif
+       else
+       {
+               // debug to test against everything
+               boxmins[0] = boxmins[1] = boxmins[2] = -999999999;
+               boxmaxs[0] = boxmaxs[1] = boxmaxs[2] =  999999999;
+       }
 }
 
 /*