// list of entities to test for collisions
int numtouchedicts;
static prvm_edict_t *touchedicts[MAX_EDICTS];
+ int clipgroup;
if (hitnetworkentity)
*hitnetworkentity = 0;
// precalculate passedict's owner edict pointer for comparisons
traceowner = passedict ? PRVM_PROG_TO_EDICT(PRVM_clientedictedict(passedict, owner)) : NULL;
+ clipgroup = passedict ? (int)PRVM_clientedictfloat(passedict, clipgroup) : 0;
+
// collide against network entities
if (hitnetworkbrushmodels)
{
// don't clip owner against owned entities
if (passedictprog == PRVM_clientedictedict(touch, owner))
continue;
+ // don't clip against any entities in the same clipgroup (DP_RM_CLIPGROUP)
+ if (clipgroup && clipgroup == (int)PRVM_clientedictfloat(touch, clipgroup))
+ continue;
// don't clip points against points (they can't collide)
if (VectorCompare(PRVM_clientedictvector(touch, mins), PRVM_clientedictvector(touch, maxs)) && (type != MOVE_MISSILE || !((int)PRVM_clientedictfloat(touch, flags) & FL_MONSTER)))
continue;
// list of entities to test for collisions
int numtouchedicts;
static prvm_edict_t *touchedicts[MAX_EDICTS];
+ int clipgroup;
if (VectorCompare(start, end))
return CL_TracePoint(start, type, passedict, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities);
// precalculate passedict's owner edict pointer for comparisons
traceowner = passedict ? PRVM_PROG_TO_EDICT(PRVM_clientedictedict(passedict, owner)) : NULL;
+ clipgroup = passedict ? (int)PRVM_clientedictfloat(passedict, clipgroup) : 0;
+
// collide against network entities
if (hitnetworkbrushmodels)
{
// don't clip owner against owned entities
if (passedictprog == PRVM_clientedictedict(touch, owner))
continue;
+ // don't clip against any entities in the same clipgroup (DP_RM_CLIPGROUP)
+ if (clipgroup && clipgroup == (int)PRVM_clientedictfloat(touch, clipgroup))
+ continue;
// don't clip points against points (they can't collide)
if (VectorCompare(PRVM_clientedictvector(touch, mins), PRVM_clientedictvector(touch, maxs)) && (type != MOVE_MISSILE || !((int)PRVM_clientedictfloat(touch, flags) & FL_MONSTER)))
continue;
// list of entities to test for collisions
int numtouchedicts;
static prvm_edict_t *touchedicts[MAX_EDICTS];
+ int clipgroup;
if (VectorCompare(mins, maxs))
{
vec3_t shiftstart, shiftend;
// precalculate passedict's owner edict pointer for comparisons
traceowner = passedict ? PRVM_PROG_TO_EDICT(PRVM_clientedictedict(passedict, owner)) : NULL;
+ clipgroup = passedict ? (int)PRVM_clientedictfloat(passedict, clipgroup) : 0;
+
// collide against network entities
if (hitnetworkbrushmodels)
{
// don't clip owner against owned entities
if (passedictprog == PRVM_clientedictedict(touch, owner))
continue;
+ // don't clip against any entities in the same clipgroup (DP_RM_CLIPGROUP)
+ if (clipgroup && clipgroup == (int)PRVM_clientedictfloat(touch, clipgroup))
+ continue;
// don't clip points against points (they can't collide)
if (pointtrace && VectorCompare(PRVM_clientedictvector(touch, mins), PRVM_clientedictvector(touch, maxs)) && (type != MOVE_MISSILE || !((int)PRVM_clientedictfloat(touch, flags) & FL_MONSTER)))
continue;
float MOVETYPE_USER_LAST = 191;
//description:
//user defined movetypes can be added between the start and end points, without producing unknown movetype warnings
+
+//DP_RM_CLIPGROUP
+//idea: Akari
+//darkplaces implementation: Akari
+//field definitions:
+.float clipgroup;
+//description:
+//If two entities have this field set to the same non-zero integer value, they won't collide with each other.
PRVM_DECLARE_clientfieldfloat(bouncefactor)
PRVM_DECLARE_clientfieldfloat(bouncestop)
PRVM_DECLARE_clientfieldfloat(colormap)
+PRVM_DECLARE_clientfieldfloat(clipgroup)
PRVM_DECLARE_clientfieldfloat(dphitcontentsmask)
PRVM_DECLARE_clientfieldfloat(drawmask)
PRVM_DECLARE_clientfieldfloat(effects)
PRVM_DECLARE_field(clientcamera)
PRVM_DECLARE_field(clientcolors)
PRVM_DECLARE_field(clientstatus)
+PRVM_DECLARE_field(clipgroup)
PRVM_DECLARE_field(color)
PRVM_DECLARE_field(colormap)
PRVM_DECLARE_field(colormod)
PRVM_DECLARE_serverfieldfloat(buttonchat)
PRVM_DECLARE_serverfieldfloat(buttonuse)
PRVM_DECLARE_serverfieldfloat(clientcolors)
+PRVM_DECLARE_serverfieldfloat(clipgroup)
PRVM_DECLARE_serverfieldfloat(colormap)
PRVM_DECLARE_serverfieldfloat(currentammo)
PRVM_DECLARE_serverfieldfloat(cursor_active)
// list of entities to test for collisions
int numtouchedicts;
static prvm_edict_t *touchedicts[MAX_EDICTS];
+ int clipgroup;
//return SV_TraceBox(start, vec3_origin, vec3_origin, end, type, passedict, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask);
// precalculate passedict's owner edict pointer for comparisons
traceowner = passedict ? PRVM_PROG_TO_EDICT(PRVM_serveredictedict(passedict, owner)) : 0;
+ clipgroup = passedict ? (int)PRVM_serveredictfloat(passedict, clipgroup) : 0;
+
// clip to entities
// because this uses World_EntitiestoBox, we know all entity boxes overlap
// the clip region, so we can skip culling checks in the loop below
// don't clip owner against owned entities
if (passedictprog == PRVM_serveredictedict(touch, owner))
continue;
+ // don't clip against any entities in the same clipgroup (DP_RM_CLIPGROUP)
+ if (clipgroup && clipgroup == (int)PRVM_serveredictfloat(touch, clipgroup))
+ continue;
// don't clip points against points (they can't collide)
if (VectorCompare(PRVM_serveredictvector(touch, mins), PRVM_serveredictvector(touch, maxs)) && (type != MOVE_MISSILE || !((int)PRVM_serveredictfloat(touch, flags) & FL_MONSTER)))
continue;
// list of entities to test for collisions
int numtouchedicts;
static prvm_edict_t *touchedicts[MAX_EDICTS];
+ int clipgroup;
if (VectorCompare(start, end))
return SV_TracePoint(start, type, passedict, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask);
// precalculate passedict's owner edict pointer for comparisons
traceowner = passedict ? PRVM_PROG_TO_EDICT(PRVM_serveredictedict(passedict, owner)) : 0;
+ clipgroup = passedict ? (int)PRVM_serveredictfloat(passedict, clipgroup) : 0;
+
// clip to entities
// because this uses World_EntitiestoBox, we know all entity boxes overlap
// the clip region, so we can skip culling checks in the loop below
// don't clip owner against owned entities
if (passedictprog == PRVM_serveredictedict(touch, owner))
continue;
+ // don't clip against any entities in the same clipgroup (DP_RM_CLIPGROUP)
+ if (clipgroup && clipgroup == (int)PRVM_serveredictfloat(touch, clipgroup))
+ continue;
// don't clip points against points (they can't collide)
if (VectorCompare(PRVM_serveredictvector(touch, mins), PRVM_serveredictvector(touch, maxs)) && (type != MOVE_MISSILE || !((int)PRVM_serveredictfloat(touch, flags) & FL_MONSTER)))
continue;
// list of entities to test for collisions
int numtouchedicts;
static prvm_edict_t *touchedicts[MAX_EDICTS];
+ int clipgroup;
if (VectorCompare(mins, maxs))
{
vec3_t shiftstart, shiftend;
// precalculate passedict's owner edict pointer for comparisons
traceowner = passedict ? PRVM_PROG_TO_EDICT(PRVM_serveredictedict(passedict, owner)) : 0;
+ clipgroup = passedict ? (int)PRVM_serveredictfloat(passedict, clipgroup) : 0;
+
// clip to entities
// because this uses World_EntitiestoBox, we know all entity boxes overlap
// the clip region, so we can skip culling checks in the loop below
// don't clip owner against owned entities
if (passedictprog == PRVM_serveredictedict(touch, owner))
continue;
+ // don't clip against any entities in the same clipgroup (DP_RM_CLIPGROUP)
+ if (clipgroup && clipgroup == (int)PRVM_serveredictfloat(touch, clipgroup))
+ continue;
// don't clip points against points (they can't collide)
if (pointtrace && VectorCompare(PRVM_serveredictvector(touch, mins), PRVM_serveredictvector(touch, maxs)) && (type != MOVE_MISSILE || !((int)PRVM_serveredictfloat(touch, flags) & FL_MONSTER)))
continue;
"TENEBRAE_GFX_DLIGHTS "
"TW_SV_STEPCONTROL "
"ZQ_PAUSE "
+"DP_RM_CLIPGROUP "
//"EXT_CSQC " // not ready yet
;