X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;ds=inline;f=sv_phys.c;h=a69f278321db9405436d3d41f3af1a2974812875;hb=b74281e908fa2cd02b711856cfbdc983300bf96d;hp=fb567c8e5124da05b28cf0f57728b030e518ec4e;hpb=52bb3f7e43667d443f017bacdeaa5d99a2619e49;p=xonotic%2Fdarkplaces.git diff --git a/sv_phys.c b/sv_phys.c index fb567c8e..a69f2783 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -247,16 +247,21 @@ int SV_FlyMove (edict_t *ent, float time, float *stepnormal) VectorMA(ent->v->origin, time, ent->v->velocity, end); trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, end, MOVE_NORMAL, ent); //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]); -#ifdef COLLISIONPARANOID +#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; - Con_Printf("%s{%i:%f %f %f:%f %f %f:%f:%f %f %f%s%s}\n", (trace.startsolid || endstuck) ? "\002" : "", bumpcount, ent->v->origin[0], ent->v->origin[1], ent->v->origin[2], end[0] - ent->v->origin[0], end[1] - ent->v->origin[1], end[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"); +#if COLLISIONPARANOID < 2 + if (trace.startsolid || endstuck) +#endif + { + Con_Printf("%s{e%i:%i:%f %f %f:%f %f %f:%f:%f %f %f%s%s}\n", (trace.startsolid || endstuck) ? "\002" : "", ent - sv.edicts, bumpcount, ent->v->origin[0], ent->v->origin[1], ent->v->origin[2], end[0] - ent->v->origin[0], end[1] - ent->v->origin[1], end[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 @@ -531,6 +536,23 @@ trace_t SV_PushEntity (edict_t *ent, vec3_t push, vec3_t pushangles) trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, end, MOVE_NOMONSTERS, ent); else trace = SV_Move (ent->v->origin, ent->v->mins, ent->v->maxs, end, 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], end[0] - ent->v->origin[0], end[1] - ent->v->origin[1], end[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 VectorCopy (trace.endpos, ent->v->origin); // FIXME: turn players specially @@ -956,7 +978,10 @@ int SV_TryUnstick (edict_t *ent, vec3_t oldvel) if (fabs(oldorg[1] - ent->v->origin[1]) > 4 || fabs(oldorg[0] - ent->v->origin[0]) > 4) + { + Con_DPrintf("TryUnstick - success.\n"); return clip; + } // go back to the original pos and try again VectorCopy (oldorg, ent->v->origin); @@ -964,6 +989,7 @@ int SV_TryUnstick (edict_t *ent, vec3_t oldvel) // still not moving VectorClear (ent->v->velocity); + Con_Printf("TryUnstick - failure.\n"); return 7; }