// world.c -- world query functions
#include "quakedef.h"
+#include "csprogs.h"
/*
model->TraceBox(model, frame, &trace, starttransformed, mins, maxs, endtransformed, hitsupercontents);
}
else
- Collision_ClipTrace_Box(&trace, ent->fields.client->mins, ent->fields.client->maxs, starttransformed, mins, maxs, endtransformed, hitsupercontents, SUPERCONTENTS_SOLID);
+ Collision_ClipTrace_Box(&trace, ent->fields.client->mins, ent->fields.client->maxs, starttransformed, mins, maxs, endtransformed, hitsupercontents, ent->fields.client->solid == SOLID_CORPSE ? SUPERCONTENTS_CORPSE : SUPERCONTENTS_BODY, 0, NULL);
trace.fraction = bound(0, trace.fraction, 1);
trace.realfraction = bound(0, trace.realfraction, 1);
int passedictprog;
qboolean pointtrace;
prvm_edict_t *traceowner, *touch;
+ prvm_eval_t *val;
trace_t trace;
// bounding box of entire move area
vec3_t clipboxmins, clipboxmaxs;
Con_Printf("move(%f %f %f,%f %f %f)", clipstart[0], clipstart[1], clipstart[2], clipend[0], clipend[1], clipend[2]);
#endif
- hitsupercontentsmask = SUPERCONTENTS_SOLID;
if (passedict)
{
- if (passedict->fields.client->solid == SOLID_SLIDEBOX)
- hitsupercontentsmask |= SUPERCONTENTS_PLAYERCLIP;
- if ((int)passedict->fields.client->flags & FL_MONSTER)
- hitsupercontentsmask |= SUPERCONTENTS_MONSTERCLIP;
+ val = PRVM_GETEDICTFIELDVALUE(passedict, csqc_fieldoff_dphitcontentsmask);
+ if (val && val->_float)
+ hitsupercontentsmask = (int)val->_float;
+ else if (passedict->fields.client->solid == SOLID_SLIDEBOX)
+ {
+ if ((int)passedict->fields.client->flags & FL_MONSTER)
+ hitsupercontentsmask = SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_MONSTERCLIP;
+ else
+ hitsupercontentsmask = SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_PLAYERCLIP;
+ }
+ else if (passedict->fields.client->solid == SOLID_CORPSE)
+ hitsupercontentsmask = SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY;
+ else
+ hitsupercontentsmask = SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_CORPSE;
}
+ else
+ hitsupercontentsmask = SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | SUPERCONTENTS_CORPSE;
// clip to world
cliptrace = CSSV_ClipMoveToEntity(prog->edicts, clipstart, clipmins, clipmaxs, clipend, type, hitsupercontentsmask);
+ cliptrace.bmodelstartsolid = cliptrace.startsolid;
if (cliptrace.startsolid || cliptrace.fraction < 1)
cliptrace.ent = prog->edicts;
if (type == MOVE_WORLDONLY)
// don't clip points against points (they can't collide)
if (pointtrace && VectorCompare(touch->fields.client->mins, touch->fields.client->maxs) && (type != MOVE_MISSILE || !((int)touch->fields.client->flags & FL_MONSTER)))
continue;
- // don't clip corpse against character
- if (passedict->fields.client->solid == SOLID_CORPSE && (touch->fields.client->solid == SOLID_SLIDEBOX || touch->fields.client->solid == SOLID_CORPSE))
- continue;
- // don't clip character against corpse
- if (passedict->fields.client->solid == SOLID_SLIDEBOX && touch->fields.client->solid == SOLID_CORPSE)
- continue;
}
// might interact, so do an exact clip
cliptrace.allsolid = true;
if (trace.startsolid)
{
+ if (touch->fields.client->solid == SOLID_BSP)
+ cliptrace.bmodelstartsolid = true;
cliptrace.startsolid = true;
if (cliptrace.realfraction == 1)
cliptrace.ent = touch;
VectorCopy(trace.endpos, cliptrace.endpos);
cliptrace.plane = trace.plane;
cliptrace.ent = touch;
+ cliptrace.hitsupercontents = trace.hitsupercontents;
+ cliptrace.hitq3surfaceflags = trace.hitq3surfaceflags;
+ cliptrace.hittexture = trace.hittexture;
}
cliptrace.startsupercontents |= trace.startsupercontents;
}