This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/engine/server/sv_world.c

594 lines
15 KiB
C
Raw Normal View History

2007-06-21 22:00:00 +02:00
/*
Copyright (C) 1997-2001 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// world.c -- world query functions
#include "engine.h"
#include "server.h"
/*
===============================================================================
ENTITY AREA CHECKING
FIXME: this use of "area" is different from the bsp file use
===============================================================================
*/
typedef struct areanode_s
{
int axis; // -1 = leaf node
float dist;
struct areanode_s *children[2];
link_t trigger_edicts;
link_t solid_edicts;
} areanode_t;
#define AREA_DEPTH 4
#define AREA_NODES 32
areanode_t sv_areanodes[AREA_NODES];
int sv_numareanodes;
2007-09-02 22:00:00 +02:00
float *area_mins, *area_maxs;
prvm_edict_t **area_list;
2007-06-21 22:00:00 +02:00
int area_count, area_maxcount;
int area_type;
2007-09-02 22:00:00 +02:00
int SV_HullForEntity (prvm_edict_t *ent);
2007-06-21 22:00:00 +02:00
// ClearLink is used for new headnodes
void ClearLink (link_t *l)
{
l->prev = l->next = l;
}
void RemoveLink (link_t *l)
{
l->next->prev = l->prev;
l->prev->next = l->next;
}
2007-09-05 22:00:00 +02:00
void InsertLinkBefore (link_t *l, link_t *before, int entnum)
2007-06-21 22:00:00 +02:00
{
2007-09-05 22:00:00 +02:00
l->entnum = entnum;
2007-06-21 22:00:00 +02:00
l->next = before;
l->prev = before->prev;
l->prev->next = l;
l->next->prev = l;
}
/*
===============
SV_CreateAreaNode
Builds a uniformly subdivided tree for the given world size
===============
*/
areanode_t *SV_CreateAreaNode (int depth, vec3_t mins, vec3_t maxs)
{
areanode_t *anode;
vec3_t size;
vec3_t mins1, maxs1, mins2, maxs2;
anode = &sv_areanodes[sv_numareanodes];
sv_numareanodes++;
ClearLink (&anode->trigger_edicts);
ClearLink (&anode->solid_edicts);
if (depth == AREA_DEPTH)
{
anode->axis = -1;
anode->children[0] = anode->children[1] = NULL;
return anode;
}
VectorSubtract (maxs, mins, size);
if (size[0] > size[1])
anode->axis = 0;
else
anode->axis = 1;
anode->dist = 0.5 * (maxs[anode->axis] + mins[anode->axis]);
VectorCopy (mins, mins1);
VectorCopy (mins, mins2);
VectorCopy (maxs, maxs1);
VectorCopy (maxs, maxs2);
maxs1[anode->axis] = mins2[anode->axis] = anode->dist;
anode->children[0] = SV_CreateAreaNode (depth+1, mins2, maxs2);
anode->children[1] = SV_CreateAreaNode (depth+1, mins1, maxs1);
return anode;
}
/*
===============
SV_ClearWorld
===============
*/
void SV_ClearWorld (void)
{
memset (sv_areanodes, 0, sizeof(sv_areanodes));
sv_numareanodes = 0;
SV_CreateAreaNode (0, sv.models[1]->mins, sv.models[1]->maxs);
}
/*
===============
SV_UnlinkEdict
===============
*/
2007-09-02 22:00:00 +02:00
void SV_UnlinkEdict (prvm_edict_t *ent)
2007-06-21 22:00:00 +02:00
{
2007-09-02 22:00:00 +02:00
if (!ent->priv.sv->area.prev) return; // not linked in anywhere
RemoveLink (&ent->priv.sv->area);
ent->priv.sv->area.prev = ent->priv.sv->area.next = NULL;
2007-06-21 22:00:00 +02:00
}
/*
===============
SV_LinkEdict
===============
*/
#define MAX_TOTAL_ENT_LEAFS 128
2007-09-02 22:00:00 +02:00
void SV_LinkEdict (prvm_edict_t *ent)
2007-06-21 22:00:00 +02:00
{
areanode_t *node;
2007-09-04 22:00:00 +02:00
int leafs[MAX_TOTAL_ENT_LEAFS];
int clusters[MAX_TOTAL_ENT_LEAFS];
int num_leafs;
int i, j, k;
int area;
int topnode;
2007-06-21 22:00:00 +02:00
2007-09-02 22:00:00 +02:00
if (ent->priv.sv->area.prev) SV_UnlinkEdict (ent); // unlink from old position
if (ent == prog->edicts) return; // don't add the world
2007-09-05 22:00:00 +02:00
if (ent->priv.sv->free)
{
Msg("Can't link entity [%d]\n", ent->priv.sv->state.number );
return;
}
2007-06-21 22:00:00 +02:00
// set the size
2007-09-04 22:00:00 +02:00
VectorSubtract (ent->fields.sv->maxs, ent->fields.sv->mins, ent->fields.sv->size);
2007-06-21 22:00:00 +02:00
// encode the size into the entity_state for client prediction
2007-09-04 22:00:00 +02:00
if (ent->fields.sv->solid == SOLID_BBOX && !((int)ent->fields.sv->flags & SVF_DEADMONSTER))
2007-08-17 22:00:00 +02:00
{
// assume that x/y are equal and symetric
2007-09-04 22:00:00 +02:00
i = ent->fields.sv->maxs[0]/8;
if(i < 1) i = 1;
if(i > 31) i = 31;
2007-06-21 22:00:00 +02:00
// z is not symetric
2007-09-04 22:00:00 +02:00
j = (-ent->fields.sv->mins[2])/8;
2007-08-17 22:00:00 +02:00
if (j < 1) j = 1;
if (j > 31) j = 31;
2007-06-21 22:00:00 +02:00
// and z maxs can be negative...
2007-09-04 22:00:00 +02:00
k = (ent->fields.sv->maxs[2]+32)/8;
if (k < 1) k = 1;
if (k > 63) k = 63;
ent->fields.sv->solid = (k<<10) | (j<<5) | i;
2007-06-21 22:00:00 +02:00
}
2007-09-04 22:00:00 +02:00
else if (ent->fields.sv->solid == SOLID_BSP)
2007-06-21 22:00:00 +02:00
{
2007-09-04 22:00:00 +02:00
ent->fields.sv->solid = 31; // a solid_bbox will never create this value
2007-06-21 22:00:00 +02:00
}
2007-09-04 22:00:00 +02:00
else ent->fields.sv->solid = 0;
2007-06-21 22:00:00 +02:00
// set the abs box
2007-09-04 22:00:00 +02:00
if (ent->fields.sv->solid == SOLID_BSP && (!VectorIsNull(ent->fields.sv->angles)))
2007-08-17 22:00:00 +02:00
{
// expand for rotation
float max = 0, v;
int i;
2007-06-21 22:00:00 +02:00
2007-09-02 22:00:00 +02:00
for (i = 0; i < 3; i++)
2007-06-21 22:00:00 +02:00
{
2007-09-04 22:00:00 +02:00
v =fabs( ent->fields.sv->mins[i]);
2007-08-17 22:00:00 +02:00
if (v > max) max = v;
2007-09-04 22:00:00 +02:00
v =fabs( ent->fields.sv->maxs[i]);
2007-08-17 22:00:00 +02:00
if (v > max) max = v;
2007-06-21 22:00:00 +02:00
}
2007-09-02 22:00:00 +02:00
for (i = 0; i < 3; i++)
2007-06-21 22:00:00 +02:00
{
2007-09-04 22:00:00 +02:00
ent->fields.sv->absmin[i] = ent->fields.sv->origin[i] - max;
ent->fields.sv->absmax[i] = ent->fields.sv->origin[i] + max;
2007-06-21 22:00:00 +02:00
}
}
else
2007-09-05 22:00:00 +02:00
{
// normal
2007-09-04 22:00:00 +02:00
VectorAdd (ent->fields.sv->origin, ent->fields.sv->mins, ent->fields.sv->absmin);
VectorAdd (ent->fields.sv->origin, ent->fields.sv->maxs, ent->fields.sv->absmax);
2007-06-21 22:00:00 +02:00
}
// because movement is clipped an epsilon away from an actual edge,
// we must fully check even when bounding boxes don't quite touch
2007-09-04 22:00:00 +02:00
ent->fields.sv->absmin[0] -= 1;
ent->fields.sv->absmin[1] -= 1;
ent->fields.sv->absmin[2] -= 1;
ent->fields.sv->absmax[0] += 1;
ent->fields.sv->absmax[1] += 1;
ent->fields.sv->absmax[2] += 1;
2007-06-21 22:00:00 +02:00
2007-08-17 22:00:00 +02:00
// link to PVS leafs
2007-09-02 22:00:00 +02:00
ent->priv.sv->num_clusters = 0;
ent->priv.sv->areanum = 0;
ent->priv.sv->areanum2 = 0;
2007-06-21 22:00:00 +02:00
//get all leafs, including solids
2007-09-04 22:00:00 +02:00
num_leafs = CM_BoxLeafnums (ent->fields.sv->absmin, ent->fields.sv->absmax, leafs, MAX_TOTAL_ENT_LEAFS, &topnode);
2007-06-21 22:00:00 +02:00
// set areas
2007-08-17 22:00:00 +02:00
for (i = 0; i < num_leafs; i++)
2007-06-21 22:00:00 +02:00
{
clusters[i] = CM_LeafCluster (leafs[i]);
area = CM_LeafArea (leafs[i]);
if (area)
{ // doors may legally straggle two areas,
// but nothing should evern need more than that
2007-09-02 22:00:00 +02:00
if (ent->priv.sv->areanum && ent->priv.sv->areanum != area)
2007-06-21 22:00:00 +02:00
{
2007-09-02 22:00:00 +02:00
if (ent->priv.sv->areanum2 && ent->priv.sv->areanum2 != area && sv.state == ss_loading)
2007-09-04 22:00:00 +02:00
MsgWarn("SV_LinkEdict: object touching 3 areas at %f %f %f\n", ent->fields.sv->absmin[0], ent->fields.sv->absmin[1], ent->fields.sv->absmin[2]);
2007-09-02 22:00:00 +02:00
ent->priv.sv->areanum2 = area;
2007-06-21 22:00:00 +02:00
}
2007-09-02 22:00:00 +02:00
else ent->priv.sv->areanum = area;
2007-06-21 22:00:00 +02:00
}
}
if (num_leafs >= MAX_TOTAL_ENT_LEAFS)
2007-08-17 22:00:00 +02:00
{
// assume we missed some leafs, and mark by headnode
2007-09-02 22:00:00 +02:00
ent->priv.sv->num_clusters = -1;
ent->priv.sv->headnode = topnode;
2007-06-21 22:00:00 +02:00
}
else
{
2007-09-02 22:00:00 +02:00
ent->priv.sv->num_clusters = 0;
2007-08-17 22:00:00 +02:00
for (i = 0; i < num_leafs; i++)
2007-06-21 22:00:00 +02:00
{
2007-08-17 22:00:00 +02:00
if (clusters[i] == -1) continue; // not a visible leaf
for (j = 0; j < i; j++)
{
if (clusters[j] == clusters[i]) break;
}
2007-06-21 22:00:00 +02:00
if (j == i)
{
2007-09-02 22:00:00 +02:00
if (ent->priv.sv->num_clusters == MAX_ENT_CLUSTERS)
2007-08-17 22:00:00 +02:00
{
// assume we missed some leafs, and mark by headnode
2007-09-02 22:00:00 +02:00
ent->priv.sv->num_clusters = -1;
ent->priv.sv->headnode = topnode;
2007-06-21 22:00:00 +02:00
break;
}
2007-09-02 22:00:00 +02:00
ent->priv.sv->clusternums[ent->priv.sv->num_clusters++] = clusters[i];
2007-06-21 22:00:00 +02:00
}
}
}
// if first time, make sure old_origin is valid
2007-09-02 22:00:00 +02:00
if (!ent->priv.sv->linkcount)
2007-06-21 22:00:00 +02:00
{
2007-09-04 22:00:00 +02:00
VectorCopy (ent->fields.sv->origin, ent->fields.sv->oldorigin);
2007-06-21 22:00:00 +02:00
}
2007-09-02 22:00:00 +02:00
ent->priv.sv->linkcount++;
2007-06-21 22:00:00 +02:00
2007-09-04 22:00:00 +02:00
if (ent->fields.sv->solid == SOLID_NOT) return;
2007-06-21 22:00:00 +02:00
2007-08-17 22:00:00 +02:00
// find the first node that the ent's box crosses
2007-06-21 22:00:00 +02:00
node = sv_areanodes;
while (1)
{
2007-08-17 22:00:00 +02:00
if (node->axis == -1) break;
2007-09-04 22:00:00 +02:00
if (ent->fields.sv->absmin[node->axis] > node->dist)
2007-06-21 22:00:00 +02:00
node = node->children[0];
2007-09-04 22:00:00 +02:00
else if (ent->fields.sv->absmax[node->axis] < node->dist)
2007-06-21 22:00:00 +02:00
node = node->children[1];
2007-08-17 22:00:00 +02:00
else break; // crosses the node
2007-06-21 22:00:00 +02:00
}
// link it in
2007-09-05 22:00:00 +02:00
if (ent->fields.sv->solid == SOLID_TRIGGER)
InsertLinkBefore (&ent->priv.sv->area, &node->trigger_edicts, PRVM_NUM_FOR_EDICT(ent));
else InsertLinkBefore (&ent->priv.sv->area, &node->solid_edicts, PRVM_NUM_FOR_EDICT(ent));
2007-06-21 22:00:00 +02:00
}
/*
====================
SV_AreaEdicts_r
====================
*/
void SV_AreaEdicts_r (areanode_t *node)
{
link_t *l, *next, *start;
2007-09-02 22:00:00 +02:00
prvm_edict_t *check;
2007-08-17 22:00:00 +02:00
int count = 0;
2007-06-21 22:00:00 +02:00
// touch linked edicts
if (area_type == AREA_SOLID)
start = &node->solid_edicts;
2007-08-17 22:00:00 +02:00
else start = &node->trigger_edicts;
2007-06-21 22:00:00 +02:00
2007-08-17 22:00:00 +02:00
for (l = start->next; l != start; l = next)
2007-06-21 22:00:00 +02:00
{
next = l->next;
2007-09-05 22:00:00 +02:00
check = PRVM_EDICT_NUM_UNSIGNED(l->entnum);
2007-06-21 22:00:00 +02:00
2007-09-04 22:00:00 +02:00
if (check->fields.sv->solid == SOLID_NOT) continue; // deactivated
if (check->fields.sv->absmin[0] > area_maxs[0] || check->fields.sv->absmin[1] > area_maxs[1] || check->fields.sv->absmin[2] > area_maxs[2]
|| check->fields.sv->absmax[0] < area_mins[0] || check->fields.sv->absmax[1] < area_mins[1] || check->fields.sv->absmax[2] < area_mins[2])
2007-08-17 22:00:00 +02:00
continue; // not touching
2007-06-21 22:00:00 +02:00
if (area_count == area_maxcount)
{
2007-08-17 22:00:00 +02:00
MsgWarn("SV_AreaEdicts: maxcount\n");
2007-06-21 22:00:00 +02:00
return;
}
area_list[area_count] = check;
area_count++;
}
2007-08-17 22:00:00 +02:00
if (node->axis == -1) return; // terminal node
2007-06-21 22:00:00 +02:00
// recurse down both sides
2007-09-05 22:00:00 +02:00
if ( area_maxs[node->axis] > node->dist ) SV_AreaEdicts_r ( node->children[0] );
if ( area_mins[node->axis] < node->dist ) SV_AreaEdicts_r ( node->children[1] );
2007-06-21 22:00:00 +02:00
}
/*
================
SV_AreaEdicts
================
*/
2007-09-02 22:00:00 +02:00
int SV_AreaEdicts (vec3_t mins, vec3_t maxs, prvm_edict_t **list, int maxcount, int areatype)
2007-06-21 22:00:00 +02:00
{
area_mins = mins;
area_maxs = maxs;
area_list = list;
area_count = 0;
area_maxcount = maxcount;
area_type = areatype;
SV_AreaEdicts_r (sv_areanodes);
return area_count;
}
//===========================================================================
/*
=============
SV_PointContents
=============
*/
int SV_PointContents (vec3_t p)
{
2007-09-02 22:00:00 +02:00
prvm_edict_t *touch[MAX_EDICTS], *hit;
2007-08-17 22:00:00 +02:00
int i, num;
int contents, c2;
int headnode;
2007-06-21 22:00:00 +02:00
float *angles;
// get base contents from world
contents = CM_PointContents (p, sv.models[1]->headnode);
// or in contents from all the other entities
num = SV_AreaEdicts (p, p, touch, MAX_EDICTS, AREA_SOLID);
2007-08-17 22:00:00 +02:00
for (i = 0; i < num; i++)
2007-06-21 22:00:00 +02:00
{
hit = touch[i];
// might intersect, so do an exact clip
headnode = SV_HullForEntity (hit);
2007-09-04 22:00:00 +02:00
angles = hit->fields.sv->angles;
if (hit->fields.sv->solid != SOLID_BSP) angles = vec3_origin; // boxes don't rotate
c2 = CM_TransformedPointContents (p, headnode, hit->fields.sv->origin, hit->fields.sv->angles);
2007-06-21 22:00:00 +02:00
contents |= c2;
}
return contents;
}
/*
================
SV_HullForEntity
Returns a headnode that can be used for testing or clipping an
object of mins/maxs size.
Offset is filled in to contain the adjustment that must be added to the
testing object's origin to get a point to use with the returned hull.
================
*/
2007-09-02 22:00:00 +02:00
int SV_HullForEntity (prvm_edict_t *ent)
2007-06-21 22:00:00 +02:00
{
cmodel_t *model;
2007-08-17 22:00:00 +02:00
// decide which clipping hull to use, based on the size
2007-09-04 22:00:00 +02:00
if (ent->fields.sv->solid == SOLID_BSP)
2007-08-17 22:00:00 +02:00
{
// explicit hulls in the BSP model
2007-09-04 22:00:00 +02:00
model = sv.models[ (int)ent->fields.sv->modelindex ];
2007-06-21 22:00:00 +02:00
2007-08-19 22:00:00 +02:00
if (!model)
{
MsgWarn("SV_HullForEntity: movetype_push with a non bsp model\n");
return -1;
}
2007-06-21 22:00:00 +02:00
return model->headnode;
}
// create a temp hull from bounding box sizes
2007-09-04 22:00:00 +02:00
return CM_HeadnodeForBox (ent->fields.sv->mins, ent->fields.sv->maxs);
2007-06-21 22:00:00 +02:00
}
/*
====================
SV_ClipMoveToEntities
====================
*/
void SV_ClipMoveToEntities ( moveclip_t *clip )
{
2007-08-17 22:00:00 +02:00
int i, num;
2007-09-02 22:00:00 +02:00
prvm_edict_t *touchlist[MAX_EDICTS], *touch;
2007-06-21 22:00:00 +02:00
trace_t trace;
2007-08-17 22:00:00 +02:00
int headnode;
2007-06-21 22:00:00 +02:00
float *angles;
2007-08-17 22:00:00 +02:00
num = SV_AreaEdicts (clip->boxmins, clip->boxmaxs, touchlist, MAX_EDICTS, AREA_SOLID);
2007-06-21 22:00:00 +02:00
// be careful, it is possible to have an entity in this
// list removed before we get to it (killtriggered)
2007-08-17 22:00:00 +02:00
for (i = 0; i < num; i++)
2007-06-21 22:00:00 +02:00
{
touch = touchlist[i];
2007-09-04 22:00:00 +02:00
if (touch->fields.sv->solid == SOLID_NOT) continue;
2007-08-17 22:00:00 +02:00
if (touch == clip->passedict) continue;
if (clip->trace.allsolid) return;
2007-06-21 22:00:00 +02:00
if (clip->passedict)
{
2007-09-04 22:00:00 +02:00
if (PRVM_PROG_TO_EDICT(touch->fields.sv->owner) == clip->passedict)
continue; // don't clip against own missiles
if (PRVM_PROG_TO_EDICT(clip->passedict->fields.sv->owner) == touch)
continue; // don't clip against owner
2007-06-21 22:00:00 +02:00
}
2007-09-04 22:00:00 +02:00
if ( !(clip->contentmask & CONTENTS_DEADMONSTER) && ((int)touch->fields.sv->flags & SVF_DEADMONSTER) )
2007-08-17 22:00:00 +02:00
continue;
2007-06-21 22:00:00 +02:00
// might intersect, so do an exact clip
headnode = SV_HullForEntity (touch);
2007-09-04 22:00:00 +02:00
angles = touch->fields.sv->angles;
if (touch->fields.sv->solid != SOLID_BSP) angles = vec3_origin; // boxes don't rotate
2007-06-21 22:00:00 +02:00
2007-09-04 22:00:00 +02:00
if ((int)touch->fields.sv->flags & SVF_MONSTER)
2007-08-17 22:00:00 +02:00
{
2007-09-04 22:00:00 +02:00
trace = CM_TransformedBoxTrace (clip->start, clip->end, clip->mins2, clip->maxs2, headnode, clip->contentmask, touch->fields.sv->origin, angles);
2007-08-17 22:00:00 +02:00
}
2007-06-21 22:00:00 +02:00
else
2007-08-17 22:00:00 +02:00
{
2007-09-04 22:00:00 +02:00
trace = CM_TransformedBoxTrace (clip->start, clip->end, clip->mins, clip->maxs, headnode, clip->contentmask, touch->fields.sv->origin, angles);
2007-08-17 22:00:00 +02:00
}
if (trace.allsolid || trace.startsolid || trace.fraction < clip->trace.fraction)
2007-06-21 22:00:00 +02:00
{
trace.ent = touch;
if (clip->trace.startsolid)
{
clip->trace = trace;
clip->trace.startsolid = true;
}
2007-08-17 22:00:00 +02:00
else clip->trace = trace;
2007-06-21 22:00:00 +02:00
}
2007-09-02 22:00:00 +02:00
else if (trace.startsolid)
{
clip->trace.startsolid = true;
//clip->trace.startstuck = true;
}
2007-06-21 22:00:00 +02:00
}
}
/*
==================
SV_TraceBounds
==================
*/
void SV_TraceBounds (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, vec3_t boxmins, vec3_t boxmaxs)
{
int i;
2007-08-17 22:00:00 +02:00
for (i = 0; i < 3; i++)
2007-06-21 22:00:00 +02:00
{
if (end[i] > start[i])
{
boxmins[i] = start[i] + mins[i] - 1;
boxmaxs[i] = end[i] + maxs[i] + 1;
}
else
{
boxmins[i] = end[i] + mins[i] - 1;
boxmaxs[i] = start[i] + maxs[i] + 1;
}
}
}
/*
==================
SV_Trace
Moves the given mins/maxs volume through the world from start to end.
Passedict and edicts owned by passedict are explicitly not checked.
==================
*/
2007-09-02 22:00:00 +02:00
trace_t SV_Trace (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, prvm_edict_t *passedict, int contentmask)
2007-06-21 22:00:00 +02:00
{
moveclip_t clip;
2007-08-17 22:00:00 +02:00
if (!mins) mins = vec3_origin;
if (!maxs) maxs = vec3_origin;
2007-06-21 22:00:00 +02:00
memset ( &clip, 0, sizeof ( moveclip_t ) );
// clip to world
clip.trace = CM_BoxTrace (start, end, mins, maxs, 0, contentmask);
2007-09-02 22:00:00 +02:00
clip.trace.ent = prog->edicts;
2007-08-17 22:00:00 +02:00
if (clip.trace.fraction == 0) return clip.trace; // blocked by the world
2007-06-21 22:00:00 +02:00
clip.contentmask = contentmask;
clip.start = start;
clip.end = end;
clip.mins = mins;
clip.maxs = maxs;
clip.passedict = passedict;
VectorCopy (mins, clip.mins2);
VectorCopy (maxs, clip.maxs2);
// create the bounding box of the entire move
SV_TraceBounds ( start, clip.mins2, clip.maxs2, end, clip.boxmins, clip.boxmaxs );
// clip to other solid entities
SV_ClipMoveToEntities ( &clip );
return clip.trace;
}
2007-09-03 22:00:00 +02:00
trace_t SV_ClipMoveToEntity(prvm_edict_t *ent, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int contentsmask)
2007-09-02 22:00:00 +02:00
{
2007-09-03 22:00:00 +02:00
// correct ??
return CM_BoxTrace(start, end, mins, maxs, ent->priv.sv->headnode, contentsmask);
2007-09-02 22:00:00 +02:00
}