mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-23 17:50:46 +00:00
Push entitie 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 fix is a port from KMQuake2, reported by @m-x-d. Closes #407.
This commit is contained in:
parent
025a956197
commit
1f1a45a562
1 changed files with 8 additions and 0 deletions
|
@ -535,6 +535,14 @@ retry:
|
||||||
VectorCopy(trace.endpos, ent->s.origin);
|
VectorCopy(trace.endpos, ent->s.origin);
|
||||||
gi.linkentity(ent);
|
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)
|
if (trace.fraction != 1.0)
|
||||||
{
|
{
|
||||||
SV_Impact(ent, &trace);
|
SV_Impact(ent, &trace);
|
||||||
|
|
Loading…
Reference in a new issue