move the rotated_bbox hull checks into SV_HullForEntity and move the

check == ent test in SV_TestPlayerPosition to before the abs bbox check.
This commit is contained in:
Bill Currie 2001-07-27 16:06:42 +00:00
parent 27dde8cefe
commit a3368d0f82
2 changed files with 19 additions and 27 deletions

View file

@ -357,11 +357,11 @@ PM_PlayerMove (vec3_t start, vec3_t end)
for (i = 0; i < pmove.numphysent; i++) {
pe = &pmove.physents[i];
// get the clipping hull
if (pe->model)
hull = &pmove.physents[i].model->hulls[1];
else {
if (pe->hull) {
hull = pe->hull;
if (pe->hull) {
hull = pe->hull;
} else {
if (pe->model) {
hull = &pmove.physents[i].model->hulls[1];
} else {
VectorSubtract (pe->mins, player_maxs, mins);
VectorSubtract (pe->maxs, player_mins, maxs);

View file

@ -154,6 +154,13 @@ SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
vec3_t hullmins, hullmaxs;
hull_t *hull;
if (sv_fields.rotated_bbox != -1
&& SVFIELD (ent, rotated_bbox, integer)) {
extern hull_t pf_hull_list[];
hull = &pf_hull_list[SVFIELD (ent, rotated_bbox, integer) - 1];
VectorCopy (SVFIELD (ent, origin, vector), offset);
return hull;
}
// decide which clipping hull to use, based on the size
if (SVFIELD (ent, solid, float) == SOLID_BSP) {
// explicit hulls in the BSP model
@ -632,16 +639,8 @@ SV_ClipMoveToEntity (edict_t *touched, edict_t *mover, vec3_t start,
trace.allsolid = true;
VectorCopy (end, trace.endpos);
if (sv_fields.rotated_bbox != -1
&& SVFIELD (touched, rotated_bbox, integer)) {
// keep things simple for now, only test against touched
extern hull_t pf_hull_list[];
hull = &pf_hull_list[SVFIELD (touched, rotated_bbox, integer) - 1];
VectorCopy (SVFIELD (touched, origin, vector), offset);
} else {
// get the clipping hull
hull = SV_HullForEntity (touched, mins, maxs, offset);
}
// get the clipping hull
hull = SV_HullForEntity (touched, mins, maxs, offset);
VectorSubtract (start, offset, start_l);
VectorSubtract (end, offset, end_l);
@ -828,6 +827,9 @@ SV_TestPlayerPosition (edict_t *ent, vec3_t origin)
for (e = 1; e < sv.num_edicts; e++, check = NEXT_EDICT (&sv_pr_state, check)) {
if (check->free)
continue;
if (check == ent)
continue;
if (SVFIELD (check, solid, float) != SOLID_BSP
&& SVFIELD (check, solid, float) != SOLID_BBOX
&& SVFIELD (check, solid, float) != SOLID_SLIDEBOX)
@ -841,19 +843,9 @@ SV_TestPlayerPosition (edict_t *ent, vec3_t origin)
|| boxmaxs[2] < SVFIELD (check, absmin, vector)[2])
continue;
if (check == ent)
continue;
// get the clipping hull
if (sv_fields.rotated_bbox != -1
&& SVFIELD (check, rotated_bbox, integer)) {
extern hull_t pf_hull_list[];
hull = &pf_hull_list[SVFIELD (check, rotated_bbox, integer) - 1];
VectorCopy (SVFIELD (check, origin, vector), offset);
} else {
hull = SV_HullForEntity (check, SVFIELD (ent, mins, vector),
SVFIELD (ent, maxs, vector), offset);
}
hull = SV_HullForEntity (check, SVFIELD (ent, mins, vector),
SVFIELD (ent, maxs, vector), offset);
VectorSubtract (origin, offset, offset);