mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-29 23:52:22 +00:00
Use the "real" contents of the trace's location when visiting a leaf.
When visiting a leaf in box mode, use trace_contents() to get the highest priority contents of any leafs touched by the box in the current location. I'm now down to one failing test case, and it's an "allsolid" issue that might be an incorrect assumption in my test case.
This commit is contained in:
parent
053d801e92
commit
7da6df9dfb
1 changed files with 16 additions and 7 deletions
|
@ -646,14 +646,23 @@ static int
|
|||
visit_leaf (hull_t *hull, int num, clipleaf_t *leaf, trace_t *trace,
|
||||
trace_state_t *state)
|
||||
{
|
||||
int contents;
|
||||
|
||||
// it's not possible to not be in the leaf when doing a point trace
|
||||
// if leaf is null, assume we're in the leaf
|
||||
// if plane is null, the trace did not cross the last node plane
|
||||
int in_leaf = 1;
|
||||
if (trace->type != tr_point && leaf && state->split_plane)
|
||||
in_leaf = check_in_leaf (hull, trace, leaf, state->split_plane,
|
||||
state->vel, state->origin);
|
||||
if (in_leaf && num == CONTENTS_SOLID) {
|
||||
if (trace->type != tr_point) {
|
||||
if (state->split_plane
|
||||
&& !check_in_leaf (hull, trace, leaf, state->split_plane,
|
||||
state->vel, state->origin))
|
||||
return 0; // we're not here
|
||||
//FIXME this is probably slow
|
||||
test_count++;
|
||||
contents = trace_contents (hull, trace, leaf, state->origin);
|
||||
} else {
|
||||
contents = num;
|
||||
}
|
||||
if (contents == CONTENTS_SOLID) {
|
||||
if (!state->seen_empty && !state->seen_solid) {
|
||||
// this is the first leaf visited, thus the start leaf
|
||||
trace->startsolid = state->seen_solid = true;
|
||||
|
@ -677,10 +686,10 @@ visit_leaf (hull_t *hull, int num, clipleaf_t *leaf, trace_t *trace,
|
|||
if (trace->type == tr_point)
|
||||
return 1;
|
||||
}
|
||||
} else if (in_leaf) {
|
||||
} else {
|
||||
state->seen_empty = true;
|
||||
trace->allsolid = false;
|
||||
if (num == CONTENTS_EMPTY)
|
||||
if (contents == CONTENTS_EMPTY)
|
||||
trace->inopen = true;
|
||||
else
|
||||
trace->inwater = true;
|
||||
|
|
Loading…
Reference in a new issue