mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 09:02:08 +00:00
Avoid a segfault when the hull hasn't been portalized.
Serves me right for forgetting to test the main engine :P
This commit is contained in:
parent
27642a080a
commit
d9a641c600
1 changed files with 8 additions and 4 deletions
|
@ -592,7 +592,8 @@ MOD_TraceLine (hull_t *hull, int num,
|
||||||
split_plane = tstack->plane;
|
split_plane = tstack->plane;
|
||||||
moved = tstack->start_frac > 0;
|
moved = tstack->start_frac > 0;
|
||||||
|
|
||||||
leaf = hull->nodeleafs[tstack->num].leafs[side ^ 1];
|
if (hull->nodeleafs)
|
||||||
|
leaf = hull->nodeleafs[tstack->num].leafs[side ^ 1];
|
||||||
num = hull->clipnodes[tstack->num].children[side ^ 1];
|
num = hull->clipnodes[tstack->num].children[side ^ 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,7 +607,8 @@ MOD_TraceLine (hull_t *hull, int num,
|
||||||
if (start_dist >= offset && end_dist >= offset) {
|
if (start_dist >= offset && end_dist >= offset) {
|
||||||
// entirely in front of the plane
|
// entirely in front of the plane
|
||||||
plane = 0;
|
plane = 0;
|
||||||
leaf = hull->nodeleafs[num].leafs[0];
|
if (hull->nodeleafs)
|
||||||
|
leaf = hull->nodeleafs[num].leafs[0];
|
||||||
num = node->children[0];
|
num = node->children[0];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -617,7 +619,8 @@ MOD_TraceLine (hull_t *hull, int num,
|
||||||
|| (!offset && start_dist < -offset && end_dist < -offset)) {
|
|| (!offset && start_dist < -offset && end_dist < -offset)) {
|
||||||
// entirely behind the plane
|
// entirely behind the plane
|
||||||
plane = 0;
|
plane = 0;
|
||||||
leaf = hull->nodeleafs[num].leafs[1];
|
if (hull->nodeleafs)
|
||||||
|
leaf = hull->nodeleafs[num].leafs[1];
|
||||||
num = node->children[1];
|
num = node->children[1];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -657,7 +660,8 @@ MOD_TraceLine (hull_t *hull, int num,
|
||||||
|
|
||||||
VectorMultAdd (start, frac[side], dist, end);
|
VectorMultAdd (start, frac[side], dist, end);
|
||||||
|
|
||||||
leaf = hull->nodeleafs[num].leafs[side];
|
if (hull->nodeleafs)
|
||||||
|
leaf = hull->nodeleafs[num].leafs[side];
|
||||||
num = node->children[side];
|
num = node->children[side];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue