mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-10 06:42:21 +00:00
Prevent dead bodies from obstructing elevators and falling through them
This commit is contained in:
parent
2246a943bf
commit
3bb2602f5b
1 changed files with 15 additions and 1 deletions
16
src/g_phys.c
16
src/g_phys.c
|
@ -53,7 +53,10 @@ SV_TestEntityPosition(edict_t *ent)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (ent->clipmask)
|
||||
/* dead bodies are supposed to not be solid so lets
|
||||
ensure they only collide with BSP during pushmoves
|
||||
*/
|
||||
if (ent->clipmask && !(ent->svflags & SVF_DEADMONSTER))
|
||||
{
|
||||
mask = ent->clipmask;
|
||||
}
|
||||
|
@ -518,6 +521,17 @@ retry:
|
|||
|
||||
trace = gi.trace(start, ent->mins, ent->maxs, end, ent, mask);
|
||||
|
||||
/* startsolid treats different-content volumes
|
||||
as continuous, like the bbox of a monster/player
|
||||
and the floor of an elevator. So do another trace
|
||||
that only collides with BSP so that we make a best
|
||||
effort to keep these entities inside non-solid space
|
||||
*/
|
||||
if (trace.startsolid && (mask & ~MASK_SOLID))
|
||||
{
|
||||
trace = gi.trace (start, ent->mins, ent->maxs, end, ent, MASK_SOLID);
|
||||
}
|
||||
|
||||
VectorCopy(trace.endpos, ent->s.origin);
|
||||
gi.linkentity(ent);
|
||||
|
||||
|
|
Loading…
Reference in a new issue