int CL_GenericHitSuperContentsMask(const prvm_edict_t *passedict)
{
- prvm_eval_t *val;
if (passedict)
{
- val = PRVM_EDICTFIELDVALUE(passedict, prog->fieldoffsets.dphitcontentsmask);
- if (val && val->_float)
- return (int)val->_float;
+ int dphitcontentsmask = (int)PRVM_clientedictfloat(passedict, dphitcontentsmask);
+ if (dphitcontentsmask)
+ return dphitcontentsmask;
else if (passedict->fields.client->solid == SOLID_SLIDEBOX)
{
if ((int)passedict->fields.client->flags & FL_MONSTER)
vec3_t origin, entmins, entmaxs;
matrix4x4_t entmatrix, entinversematrix;
- if(gamemode == GAME_NEXUIZ)
+ if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
{
// don't hit network players, if we are a nonsolid player
if(cl.scores[cl.playerentity-1].frags == -666 || cl.scores[cl.playerentity-1].frags == -616)
if (!cl.scores[i-1].name[0])
continue;
- if(gamemode == GAME_NEXUIZ)
+ if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
{
// don't hit spectators or nonsolid players
if(cl.scores[i-1].frags == -666 || cl.scores[i-1].frags == -616)
==================
*/
#ifdef COLLISION_STUPID_TRACE_ENDPOS_IN_SOLID_WORKAROUND
-trace_t CL_TraceLine(const vec3_t start, const vec3_t pEnd, int type, prvm_edict_t *passedict, int hitsupercontentsmask, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities)
+trace_t CL_TraceLine(const vec3_t start, const vec3_t pEnd, int type, prvm_edict_t *passedict, int hitsupercontentsmask, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities, qboolean hitsurfaces)
#else
-trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities)
+trace_t CL_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, qboolean hitnetworkbrushmodels, qboolean hitnetworkplayers, int *hitnetworkentity, qboolean hitcsqcentities, qboolean hitsurfaces)
#endif
{
int i, bodysupercontents;
#endif
// clip to world
- Collision_ClipLineToWorld(&cliptrace, cl.worldmodel, clipstart, clipend, hitsupercontentsmask);
+ Collision_ClipLineToWorld(&cliptrace, cl.worldmodel, clipstart, clipend, hitsupercontentsmask, hitsurfaces);
cliptrace.bmodelstartsolid = cliptrace.startsolid;
if (cliptrace.startsolid || cliptrace.fraction < 1)
cliptrace.ent = prog ? prog->edicts : NULL;
entity_render_t *ent = &cl.entities[cl.brushmodel_entities[i]].render;
if (!BoxesOverlap(clipboxmins, clipboxmaxs, ent->mins, ent->maxs))
continue;
- Collision_ClipLineToGenericEntity(&trace, ent->model, ent->frameblend, ent->skeleton, vec3_origin, vec3_origin, 0, &ent->matrix, &ent->inversematrix, start, end, hitsupercontentsmask);
+ Collision_ClipLineToGenericEntity(&trace, ent->model, ent->frameblend, ent->skeleton, vec3_origin, vec3_origin, 0, &ent->matrix, &ent->inversematrix, start, end, hitsupercontentsmask, hitsurfaces);
if (cliptrace.realfraction > trace.realfraction && hitnetworkentity)
*hitnetworkentity = cl.brushmodel_entities[i];
Collision_CombineTraces(&cliptrace, &trace, NULL, true);
vec3_t origin, entmins, entmaxs;
matrix4x4_t entmatrix, entinversematrix;
- if(gamemode == GAME_NEXUIZ)
+ if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
{
// don't hit network players, if we are a nonsolid player
if(cl.scores[cl.playerentity-1].frags == -666 || cl.scores[cl.playerentity-1].frags == -616)
if (!cl.scores[i-1].name[0])
continue;
- if(gamemode == GAME_NEXUIZ)
+ if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
{
// don't hit spectators or nonsolid players
if(cl.scores[i-1].frags == -666 || cl.scores[i-1].frags == -616)
continue;
Matrix4x4_CreateTranslate(&entmatrix, origin[0], origin[1], origin[2]);
Matrix4x4_CreateTranslate(&entinversematrix, -origin[0], -origin[1], -origin[2]);
- Collision_ClipLineToGenericEntity(&trace, NULL, NULL, NULL, cl.playerstandmins, cl.playerstandmaxs, SUPERCONTENTS_BODY, &entmatrix, &entinversematrix, start, end, hitsupercontentsmask);
+ Collision_ClipLineToGenericEntity(&trace, NULL, NULL, NULL, cl.playerstandmins, cl.playerstandmaxs, SUPERCONTENTS_BODY, &entmatrix, &entinversematrix, start, end, hitsupercontentsmask, hitsurfaces);
if (cliptrace.realfraction > trace.realfraction && hitnetworkentity)
*hitnetworkentity = i;
Collision_CombineTraces(&cliptrace, &trace, NULL, false);
if (type == MOVE_MISSILE && (int)touch->fields.client->flags & FL_MONSTER)
Collision_ClipToGenericEntity(&trace, model, touch->priv.server->frameblend, &touch->priv.server->skeleton, touch->fields.client->mins, touch->fields.client->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipmins2, clipmaxs2, clipend, hitsupercontentsmask);
else
- Collision_ClipLineToGenericEntity(&trace, model, touch->priv.server->frameblend, &touch->priv.server->skeleton, touch->fields.client->mins, touch->fields.client->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipend, hitsupercontentsmask);
+ Collision_ClipLineToGenericEntity(&trace, model, touch->priv.server->frameblend, &touch->priv.server->skeleton, touch->fields.client->mins, touch->fields.client->maxs, bodysupercontents, &matrix, &imatrix, clipstart, clipend, hitsupercontentsmask, hitsurfaces);
if (cliptrace.realfraction > trace.realfraction && hitnetworkentity)
*hitnetworkentity = 0;
if (VectorCompare(start, pEnd))
trace = CL_TracePoint(shiftstart, type, passedict, hitsupercontentsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities);
else
- trace = CL_TraceLine(shiftstart, shiftend, type, passedict, hitsupercontentsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities);
+ trace = CL_TraceLine(shiftstart, shiftend, type, passedict, hitsupercontentsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities, false);
VectorSubtract(trace.endpos, mins, trace.endpos);
return trace;
}
if (VectorCompare(start, end))
trace = CL_TracePoint(shiftstart, type, passedict, hitsupercontentsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities);
else
- trace = CL_TraceLine(shiftstart, shiftend, type, passedict, hitsupercontentsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities);
+ trace = CL_TraceLine(shiftstart, shiftend, type, passedict, hitsupercontentsmask, hitnetworkbrushmodels, hitnetworkplayers, hitnetworkentity, hitcsqcentities, false);
VectorSubtract(trace.endpos, mins, trace.endpos);
return trace;
}
vec3_t origin, entmins, entmaxs;
matrix4x4_t entmatrix, entinversematrix;
- if(gamemode == GAME_NEXUIZ)
+ if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
{
// don't hit network players, if we are a nonsolid player
if(cl.scores[cl.playerentity-1].frags == -666 || cl.scores[cl.playerentity-1].frags == -616)
if (!cl.scores[i-1].name[0])
continue;
- if(gamemode == GAME_NEXUIZ)
+ if(gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
{
// don't hit spectators or nonsolid players
if(cl.scores[i-1].frags == -666 || cl.scores[i-1].frags == -616)