- else
- {
- VectorAdd (ent->v.origin, ent->v.mins, ent->v.absmin);
- VectorAdd (ent->v.origin, ent->v.maxs, ent->v.absmax);
- }
-
-//
-// to make items easier to pick up and allow them to be grabbed off
-// of shelves, the abs sizes are expanded
-//
- if ((int)ent->v.flags & FL_ITEM)
- {
- ent->v.absmin[0] -= 15;
- ent->v.absmin[1] -= 15;
- ent->v.absmin[2] -= 1;
- ent->v.absmax[0] += 15;
- ent->v.absmax[1] += 15;
- ent->v.absmax[2] += 1;
- }
- else
- {
- // because movement is clipped an epsilon away from an actual edge,
- // we must fully check even when bounding boxes don't quite touch
- ent->v.absmin[0] -= 1;
- ent->v.absmin[1] -= 1;
- ent->v.absmin[2] -= 1;
- ent->v.absmax[0] += 1;
- ent->v.absmax[1] += 1;
- ent->v.absmax[2] += 1;
- }
-
- if (ent->v.solid == SOLID_NOT)
- return;
-
-// find the first node that the ent's box crosses
- node = sv_areanodes;
- while (1)
- {
- if (node->axis == -1)
- break;
- if (ent->v.absmin[node->axis] > node->dist)
- node = node->children[0];
- else if (ent->v.absmax[node->axis] < node->dist)
- node = node->children[1];
- else
- break; // crosses the node
- }
-
-// link it in
-
- if (ent->v.solid == SOLID_TRIGGER)
- InsertLinkBefore (&ent->area, &node->trigger_edicts);
- else
- InsertLinkBefore (&ent->area, &node->solid_edicts);
-
-// if touch_triggers, touch all entities at this node and descend for more
- if (touch_triggers)
- SV_TouchLinks ( ent, sv_areanodes );
-}
-
-
-
-/*
-===============================================================================
-
-POINT TESTING IN HULLS
-
-===============================================================================
-*/
-
-/*
-==================
-SV_HullPointContents
-
-==================
-*/
-int SV_HullPointContents (hull_t *hull, int num, vec3_t p)
-{
- while (num >= 0)
- num = hull->clipnodes[num].children[(hull->planes[hull->clipnodes[num].planenum].type < 3 ? p[hull->planes[hull->clipnodes[num].planenum].type] : DotProduct (hull->planes[hull->clipnodes[num].planenum].normal, p)) < hull->planes[hull->clipnodes[num].planenum].dist];
-
- return num;
-}
-
-/*
-============
-SV_TestEntityPosition
-
-This could be a lot more efficient...
-============
-*/
-edict_t *SV_TestEntityPosition (edict_t *ent)
-{
- trace_t trace;
-
- trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, ent->v.origin, MOVE_NORMAL, ent);
-
- if (trace.startsolid)
- return sv.edicts;
-
- return NULL;
-}
-
-
-/*
-===============================================================================
-
-LINE TESTING IN HULLS
-
-===============================================================================
-*/
-
-/*
-==================
-SV_ClipMoveToEntity
-
-Handles selection or creation of a clipping hull, and offseting (and
-eventually rotation) of the end points
-==================
-*/
-trace_t SV_ClipMoveToEntity (edict_t *ent, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end)
-{
- int i;
- trace_t trace;
- model_t *model;
-
- i = ent->v.modelindex;
- if ((unsigned int) i >= MAX_MODELS)
- PR_RunError("SV_ClipMoveToEntity: invalid modelindex\n");
- model = sv.models[i];
- if (i != 0 && model == NULL)
- PR_RunError("SV_ClipMoveToEntity: invalid modelindex\n");
-
- if ((int) ent->v.solid == SOLID_BSP)