Push entities slightly away from non horizontal surfaces.

Otherwise the entities origin might be in the surface, which causes it
to be rendered in full black.
This commit is contained in:
Yamagi Burmeister 2019-06-15 17:46:57 +02:00
parent d6f8caed07
commit a9cc79dddf

View file

@ -517,6 +517,14 @@ retry:
VectorCopy(trace.endpos, ent->s.origin);
gi.linkentity(ent);
/* Push slightly away from non-horizontal surfaces,
prevent origin stuck in the plane which causes
the entity to be rendered in full black. */
if (trace.plane.type != 2)
{
VectorAdd(ent->s.origin, trace.plane.normal, ent->s.origin);
}
if (trace.fraction != 1.0)
{
SV_Impact(ent, &trace);