]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_move.c
made an annoying cbox message that I had forgotten to disable, into a COLLISIONPARANO...
[xonotic/darkplaces.git] / sv_move.c
index 6feab85de899d31c403c2d4fde261b5faf873c7b..c7053c22788a03fa2b878041f83e311fe2481d91 100644 (file)
--- a/sv_move.c
+++ b/sv_move.c
@@ -134,6 +134,23 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
                                        neworg[2] += 8;
                        }
                        trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, neworg, MOVE_NORMAL, ent);
+#if COLLISIONPARANOID >= 1
+       {
+               int endstuck;
+               vec3_t temp;
+               VectorCopy(trace.endpos, temp);
+               endstuck = SV_Move(temp, ent->v->mins, ent->v->maxs, temp, MOVE_WORLDONLY, ent).startsolid;
+#if COLLISIONPARANOID < 2
+               if (trace.startsolid || endstuck)
+#endif
+               {
+                       Con_Printf("%s{e%i:%f %f %f:%f %f %f:%f:%f %f %f%s%s}\n", (trace.startsolid || endstuck) ? "\002" : "", ent - sv.edicts, ent->v->origin[0], ent->v->origin[1], ent->v->origin[2], neworg[0] - ent->v->origin[0], neworg[1] - ent->v->origin[1], neworg[2] - ent->v->origin[2], trace.fraction, trace.endpos[0] - ent->v->origin[0], trace.endpos[1] - ent->v->origin[1], trace.endpos[2] - ent->v->origin[2], trace.startsolid ? " startstuck" : "", endstuck ? " endstuck" : "");
+                       //Con_Printf("trace %f %f %f : %f : %f %f %f\n", trace.endpos[0], trace.endpos[1], trace.endpos[2], trace.fraction, trace.plane.normal[0], trace.plane.normal[1], trace.plane.normal[2]);
+                       if (endstuck)
+                               Cbuf_AddText("disconnect\n");
+               }
+       }
+#endif
 
                        if (trace.fraction == 1)
                        {
@@ -161,14 +178,11 @@ qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
 
        trace = SV_Move (neworg, ent->v->mins, ent->v->maxs, end, MOVE_NORMAL, ent);
 
-       if (trace.allsolid)
-               return false;
-
        if (trace.startsolid)
        {
                neworg[2] -= sv_stepheight.value;
                trace = SV_Move (neworg, ent->v->mins, ent->v->maxs, end, MOVE_NORMAL, ent);
-               if (trace.allsolid || trace.startsolid)
+               if (trace.startsolid)
                        return false;
        }
        if (trace.fraction == 1)