If the trace hits a portal on the plane that brought us to the leaf, then
we actually are in the leaf (otherwise, we shouldn't be here and thus
should ignore the leaf). At least, that's my thinking.
Many point tests fail (but they're really using box clipping with a zero
sized box) and two box tests fail.
I got rather tired of there being multiple definitions of mostly compatible
plane types (and I need a common type anyway). dplane_t still exists for
now because I want to be careful when messing with the actual bsp format.
When the trace collides with something on both sides of a plane, the nearer
collision is required. The code now correctly checks both sides and keeps
the nearer collision.
However, there is still a problem with moves where the box is always cut
by the plane: both sides need to be tested (done), but when the first side
checked allows longer motion than the second, but still collides, only the
first side is checked. The shorter motion is required.
I'm not sure the end point needs to be moved at all, but I'll leave it
alone for now. I have a couple of failing test cases that seem to be caused
by not handling moves where the box is always cut by the plane.
Rather than setting allsolid when the trace fails to leave solid space,
clear it when the trace enters non-solid space. This is necessary because
the trace might visit only one node and thus the failure to leave solid
space will not be detected. This fixes the problem with hipnotic's bobbing
water.
seen_empty and seen_solid much better reflect their meanings, and also use
them correctly (eg, visiting an empty node does not clear seen_solid).
Hipnotic's bobbing water is still broken, though.
MOD_TraceLine now behaves the same as id's SV_RecursiveHullCheck (from
WinQuake). This means that even if the trace would escape from solid space
into non-solid space, the trace is treated as allsolid if it crosses from
one solid space to another before hitting the empty space.
trace-id.c is used only for establishing the behaviour of id's code.
This reverts commit 10232acdfe.
The problem was really in the trace code, but it got fixed by "accident"
when I had similar problems in hipnotic a couple of years later. Now to
figure out just what the trace could really should be doing.
I've been experiencing funny trace issues while playing Soul of Evil. While
I think the boxclip dregs shouldn't be causing problems, it's probably best
to clean them out properly before trying to fix anything.