mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 07:11:41 +00:00
make droptofloor continue the trace if it starts solid. fixes the ceiling
hugging sng in e1m7.
This commit is contained in:
parent
62a0919472
commit
10232acdfe
3 changed files with 18 additions and 11 deletions
|
@ -50,6 +50,8 @@ 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
|
||||
|
|
|
@ -48,9 +48,6 @@ static __attribute__ ((unused)) const char rcsid[] =
|
|||
|
||||
/* LINE TESTING IN HULLS */
|
||||
|
||||
// 1/32 epsilon to keep floating point happy
|
||||
#define DIST_EPSILON (0.03125)
|
||||
|
||||
typedef struct {
|
||||
vec3_t backpt;
|
||||
int side;
|
||||
|
|
|
@ -849,15 +849,23 @@ PF_droptofloor (progs_t *pr)
|
|||
trace = SV_Move (SVvector (ent, origin), SVvector (ent, mins),
|
||||
SVvector (ent, maxs), end, false, ent);
|
||||
|
||||
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;
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue