mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +00:00
New PF_checkmove! A direct interface to SV_Move, but named better.
(This is #98.)
This commit is contained in:
parent
c553917c53
commit
08bc0e987b
1 changed files with 40 additions and 1 deletions
|
@ -538,6 +538,45 @@ PF_traceline (progs_t *pr)
|
|||
*sv_globals.trace_ent = EDICT_TO_PROG (pr, sv.edicts);
|
||||
}
|
||||
|
||||
/*
|
||||
PF_checkmove
|
||||
|
||||
Wrapper around SV_Move, this makes PF_movetoground and PF_traceline
|
||||
redundant.
|
||||
|
||||
checkmove (start, mins, maxs, end, type, passent)
|
||||
*/
|
||||
void
|
||||
PF_checkmove (progs_t *pr)
|
||||
{
|
||||
float *start, *end, *mins, *maxs;
|
||||
trace_t trace;
|
||||
int type;
|
||||
edict_t *ent;
|
||||
|
||||
start = G_VECTOR (pr, OFS_PARM0);
|
||||
mins = G_VECTOR (pr, OFS_PARM1);
|
||||
maxs = G_VECTOR (pr, OFS_PARM2);
|
||||
end = G_VECTOR (pr, OFS_PARM3);
|
||||
type = G_FLOAT (pr, OFS_PARM4);
|
||||
ent = G_EDICT (pr, OFS_PARM5);
|
||||
|
||||
trace = SV_Move (start, mins, maxs, end, type, ent);
|
||||
|
||||
*sv_globals.trace_allsolid = trace.allsolid;
|
||||
*sv_globals.trace_startsolid = trace.startsolid;
|
||||
*sv_globals.trace_fraction = trace.fraction;
|
||||
*sv_globals.trace_inwater = trace.inwater;
|
||||
*sv_globals.trace_inopen = trace.inopen;
|
||||
VectorCopy (trace.endpos, *sv_globals.trace_endpos);
|
||||
VectorCopy (trace.plane.normal, *sv_globals.trace_plane_normal);
|
||||
*sv_globals.trace_plane_dist = trace.plane.dist;
|
||||
if (trace.ent)
|
||||
*sv_globals.trace_ent = EDICT_TO_PROG (pr, trace.ent);
|
||||
else
|
||||
*sv_globals.trace_ent = EDICT_TO_PROG (pr, sv.edicts);
|
||||
}
|
||||
|
||||
/*
|
||||
PF_checkpos
|
||||
|
||||
|
@ -1919,7 +1958,7 @@ builtin_t sv_builtins[] = {
|
|||
PF_Fixme,
|
||||
PF_Fixme,
|
||||
PF_Fixme,
|
||||
PF_Fixme,
|
||||
PF_checkmove, // 98
|
||||
PF_Checkextension, // 99
|
||||
PF_strlen,
|
||||
PF_charcount,
|
||||
|
|
Loading…
Reference in a new issue