support arbitrary hulls for players, too

This commit is contained in:
Bill Currie 2001-07-26 21:37:34 +00:00
parent 44daa25fe6
commit 6000b06de3
3 changed files with 14 additions and 3 deletions

View file

@ -59,6 +59,7 @@ typedef struct
vec3_t origin;
model_t *model; // only for bsp models
vec3_t mins, maxs; // only for non-bsp models
hull_t *hull; // hey, magic :)
int info; // for client or server to identify
} physent_t;

View file

@ -360,9 +360,13 @@ PM_PlayerMove (vec3_t start, vec3_t end)
if (pe->model)
hull = &pmove.physents[i].model->hulls[1];
else {
VectorSubtract (pe->mins, player_maxs, mins);
VectorSubtract (pe->maxs, player_mins, maxs);
hull = PM_HullForBox (mins, maxs);
if (pe->hull) {
hull = pe->hull;
} else {
VectorSubtract (pe->mins, player_maxs, mins);
VectorSubtract (pe->maxs, player_mins, maxs);
hull = PM_HullForBox (mins, maxs);
}
}
// PM_HullForEntity (ent, mins, maxs, offset);

View file

@ -1315,6 +1315,12 @@ AddLinksToPmove (areanode_t *node)
pe->model = NULL;
VectorCopy (SVFIELD (check, mins, vector), pe->mins);
VectorCopy (SVFIELD (check, maxs, vector), pe->maxs);
if (sv_fields.rotated_bbox != -1
&& SVFIELD (check, rotated_bbox, integer)) {
int h = SVFIELD (check, rotated_bbox, integer);
extern hull_t pf_hull_list[];
pe->hull = &pf_hull_list[h - 1];
}
}
}
}