diff --git a/include/world.h b/include/world.h index a641eaa79..bc272357f 100644 --- a/include/world.h +++ b/include/world.h @@ -51,8 +51,6 @@ typedef struct trace_s { struct edict_s *ent; // entity the surface is on } trace_t; -// 1/32 epsilon to keep floating point happy -#define DIST_EPSILON (0.03125) #define MOVE_NORMAL 0 #define MOVE_NOMONSTERS 1 diff --git a/libs/models/trace.c b/libs/models/trace.c index 38e0578dd..49bc7abc2 100644 --- a/libs/models/trace.c +++ b/libs/models/trace.c @@ -49,6 +49,9 @@ static __attribute__ ((used)) const char rcsid[] = /* LINE TESTING IN HULLS */ +// 1/32 epsilon to keep floating point happy +#define DIST_EPSILON (0.03125) + typedef struct { vec3_t end; int side; diff --git a/qw/source/sv_pr_cmds.c b/qw/source/sv_pr_cmds.c index aa1b48f37..552e79237 100644 --- a/qw/source/sv_pr_cmds.c +++ b/qw/source/sv_pr_cmds.c @@ -849,23 +849,15 @@ PF_droptofloor (progs_t *pr) trace = SV_Move (SVvector (ent, origin), SVvector (ent, mins), SVvector (ent, maxs), end, false, ent); - R_FLOAT (pr) = 0; - if (trace.fraction == 1 || trace.allsolid) - return; - if (trace.startsolid) { - vec3_t org; - VectorCopy (trace.endpos, org); - org[2] -= 2 * DIST_EPSILON; - trace = SV_Move (org, SVvector (ent, mins), SVvector (ent, maxs), end, - false, ent); - if (trace.fraction == 1 || trace.allsolid) - return; + if (trace.fraction == 1 || trace.allsolid) { + R_FLOAT (pr) = 0; + } else { + VectorCopy (trace.endpos, SVvector (ent, origin)); + SV_LinkEdict (ent, false); + SVfloat (ent, flags) = (int) SVfloat (ent, flags) | FL_ONGROUND; + SVentity (ent, groundentity) = EDICT_TO_PROG (pr, trace.ent); + R_FLOAT (pr) = 1; } - VectorCopy (trace.endpos, SVvector (ent, origin)); - SV_LinkEdict (ent, false); - SVfloat (ent, flags) = (int) SVfloat (ent, flags) | FL_ONGROUND; - SVentity (ent, groundentity) = EDICT_TO_PROG (pr, trace.ent); - R_FLOAT (pr) = 1; } /*