]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
hopeful fix for flymove !trace.ent error
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 26 Feb 2002 23:20:50 +0000 (23:20 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 26 Feb 2002 23:20:50 +0000 (23:20 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1578 d7cf8633-e32d-0410-b094-e92efae38249

world.c

diff --git a/world.c b/world.c
index 64a762943a029dfabb2437e05432932ba00ad811..54f59ecce4aca0ee098522e5ef6e5a996094e02d 100644 (file)
--- a/world.c
+++ b/world.c
@@ -137,7 +137,7 @@ void SV_InitBoxHull (void)
                box_planes[i].type = i>>1;
                box_planes[i].normal[i>>1] = 1;
        }
-       
+
 }
 
 
@@ -803,7 +803,7 @@ trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t max
                VectorAdd (trace.endpos, offset, trace.endpos);
                trace.ent = ent;
        }
-       else if (trace.startsolid)
+       else if (trace.allsolid || trace.startsolid)
                trace.ent = ent;
 
        return trace;
@@ -824,9 +824,9 @@ void SV_ClipToLinks ( areanode_t *node, moveclip_t *clip )
        edict_t         *touch;
        trace_t         trace;
 
+loc0:
        if (clip->trace.allsolid)
                return;
-loc0:
 // touch linked edicts
        for (l = node->solid_edicts.next ; l != &node->solid_edicts ; l = next)
        {
@@ -870,10 +870,14 @@ loc0:
                        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);
-               if (trace.allsolid || trace.startsolid || trace.fraction < clip->trace.fraction)
+               if (trace.allsolid)
                {
-                       trace.ent = touch;
-                       if (clip->trace.startsolid)
+                       clip->trace = trace;
+                       return;
+               }
+               if (trace.startsolid || trace.fraction < clip->trace.fraction)
+               {
+                       if (clip->trace.startsolid)
                        {
                                clip->trace = trace;
                                clip->trace.startsolid = true;
@@ -881,8 +885,6 @@ loc0:
                        else
                                clip->trace = trace;
                }
-               if (clip->trace.allsolid)
-                       return;
        }
 
 // recurse down both sides