]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
improved SV_TestEntityPosition in q1bsp/hlbsp by checking the 8 corner points of...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 22 Jan 2007 13:22:46 +0000 (13:22 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 22 Jan 2007 13:22:46 +0000 (13:22 +0000)
changed Stuck entity warning from developer 1 to developer 100 because it's annoying and not very helpful

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6721 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c

index c00abe7f267f5acc19b46dd372058667b6705fa8..e7e5d010443a0816fd30336014bcfdff94da67fb 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -91,7 +91,25 @@ static int SV_TestEntityPosition (prvm_edict_t *ent)
        if (trace.startsupercontents & SUPERCONTENTS_SOLID)
                return true;
        else
+       {
+               if (sv.worldmodel->brushq1.hulls && !VectorCompare(ent->fields.server->mins, ent->fields.server->maxs))
+               {
+                       // q1bsp/hlbsp use hulls and if the entity does not exactly match
+                       // a hull size it is incorrectly tested, so this code tries to
+                       // 'fix' it slightly...
+                       int i;
+                       vec3_t v;
+                       for (i = 0;i < 8;i++)
+                       {
+                               v[0] = (i & 1) ? ent->fields.server->maxs[0] : ent->fields.server->mins[0];
+                               v[1] = (i & 2) ? ent->fields.server->maxs[1] : ent->fields.server->mins[1];
+                               v[2] = (i & 4) ? ent->fields.server->maxs[2] : ent->fields.server->mins[2];
+                               if (SV_PointSuperContents(v) & SUPERCONTENTS_SOLID)
+                                       return true;
+                       }
+               }
                return false;
+       }
 }
 
 /*
@@ -1002,7 +1020,8 @@ static void SV_UnstickEntity (prvm_edict_t *ent)
                        }
 
        VectorCopy (org, ent->fields.server->origin);
-       Con_DPrintf("Stuck entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->fields.server->classname));
+       if (developer.integer >= 100)
+               Con_Printf("Stuck entity %i (classname \"%s\").\n", (int)PRVM_EDICT_TO_PROG(ent), PRVM_GetString(ent->fields.server->classname));
 }