make tracebox respond to negative-skin ents, in addition to the built-in pmove code, so mods should now be able to detect it properly.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5199 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
4290e56c56
commit
63acc99442
1 changed files with 52 additions and 1 deletions
|
@ -1284,6 +1284,54 @@ static trace_t World_ClipMoveToEntity (world_t *w, wedict_t *ent, vec3_t eorg, v
|
|||
}
|
||||
else
|
||||
{
|
||||
if (ent->v->skin < 0)
|
||||
{ //if forcedcontents is set, then ALL brushes in this model are forced to the specified contents value.
|
||||
//we achive this by tracing against ALL then forcing it after.
|
||||
int forcedcontents;
|
||||
switch((int)ent->v->skin)
|
||||
{
|
||||
case Q1CONTENTS_EMPTY:
|
||||
forcedcontents = FTECONTENTS_EMPTY;
|
||||
break;
|
||||
case Q1CONTENTS_SOLID:
|
||||
forcedcontents = FTECONTENTS_SOLID;
|
||||
break;
|
||||
case Q1CONTENTS_WATER:
|
||||
forcedcontents = FTECONTENTS_WATER;
|
||||
break;
|
||||
case Q1CONTENTS_SLIME:
|
||||
forcedcontents = FTECONTENTS_SLIME;
|
||||
break;
|
||||
case Q1CONTENTS_LAVA:
|
||||
forcedcontents = FTECONTENTS_LAVA;
|
||||
break;
|
||||
case Q1CONTENTS_SKY:
|
||||
forcedcontents = FTECONTENTS_SKY;
|
||||
break;
|
||||
case Q1CONTENTS_LADDER:
|
||||
forcedcontents = FTECONTENTS_LADDER;
|
||||
break;
|
||||
default:
|
||||
forcedcontents = 0;
|
||||
break;
|
||||
}
|
||||
if (hitcontentsmask & forcedcontents)
|
||||
{
|
||||
World_TransformedTrace(model, hullnum, &framestate, start, end, mins, maxs, capsule, &trace, eorg, ent->v->angles, ~0u);
|
||||
if (trace.contents)
|
||||
trace.contents = forcedcontents;
|
||||
}
|
||||
else
|
||||
{
|
||||
memset (&trace, 0, sizeof(trace_t));
|
||||
trace.fraction = 1;
|
||||
trace.allsolid = true;
|
||||
trace.startsolid = false;
|
||||
trace.inopen = true; //probably wrong...
|
||||
VectorCopy (end, trace.endpos);
|
||||
}
|
||||
}
|
||||
else
|
||||
World_TransformedTrace(model, hullnum, &framestate, start, end, mins, maxs, capsule, &trace, eorg, ent->v->angles, hitcontentsmask);
|
||||
}
|
||||
|
||||
|
@ -2016,9 +2064,12 @@ static void World_ClipToLinks (world_t *w, areagridlink_t *node, moveclip_t *cli
|
|||
clip->trace.startsolid |= trace.startsolid;
|
||||
clip->trace.allsolid |= trace.allsolid;
|
||||
if (!clip->trace.ent)
|
||||
{
|
||||
clip->trace.contents = trace.contents;
|
||||
clip->trace.ent = touch;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
static void World_ClipToAllLinks (world_t *w, moveclip_t *clip)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue