From 07e0682e289816a68a362b22e5025b6431c6de4b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 5 Apr 2004 23:33:46 +0000 Subject: [PATCH] make sure trace.allsolid gets set properly when skipping the PM_RecursiveHullCheck call. Fixes the lg + pent + water map ejection bug. --- qw/source/pmovetst.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/qw/source/pmovetst.c b/qw/source/pmovetst.c index 263a6dd53..a5f960ed6 100644 --- a/qw/source/pmovetst.c +++ b/qw/source/pmovetst.c @@ -425,7 +425,7 @@ pmtrace_t PM_PlayerMove (const vec3_t start, const vec3_t end) { hull_t *hull; - int i, check_box; + int i, check_box, move_missed; physent_t *pe; pmtrace_t trace, total; vec3_t maxs, mins, offset, start_l, end_l; @@ -463,15 +463,6 @@ PM_PlayerMove (const vec3_t start, const vec3_t end) VectorSubtract (start, offset, start_l); VectorSubtract (end, offset, end_l); - move[0][0] = min (start_l[0], end_l[0]); - move[0][1] = min (start_l[1], end_l[1]); - move[0][2] = min (start_l[2], end_l[2]); - move[1][0] = max (start_l[0], end_l[0]); - move[1][1] = max (start_l[1], end_l[1]); - move[1][2] = max (start_l[2], end_l[2]); - if (check_box && !bboxes_touch (move[0], move[1], mins, maxs)) - continue; - // fill in a default trace memset (&trace, 0, sizeof (pmtrace_t)); @@ -480,9 +471,30 @@ PM_PlayerMove (const vec3_t start, const vec3_t end) // trace.startsolid = true; VectorCopy (end, trace.endpos); - // trace a line through the appropriate clipping hull - PM_RecursiveHullCheck (hull, hull->firstclipnode, 0, 1, start_l, end_l, - &trace); + move_missed = 0; + if (check_box) { + move[0][0] = min (start_l[0], end_l[0]); + move[0][1] = min (start_l[1], end_l[1]); + move[0][2] = min (start_l[2], end_l[2]); + move[1][0] = max (start_l[0], end_l[0]); + move[1][1] = max (start_l[1], end_l[1]); + move[1][2] = max (start_l[2], end_l[2]); + if (!bboxes_touch (move[0], move[1], mins, maxs)) + move_missed = 1; + if (PM_HullPointContents (hull, hull->firstclipnode, + start_l) != CONTENTS_SOLID) { + // since the move missed the entity entirely, the start + // point is outside the entity and the entity's outside + // is not solid, the whole trace is not solid + trace.allsolid = false; + } + } + + if (!move_missed) { + // trace a line through the appropriate clipping hull + PM_RecursiveHullCheck (hull, hull->firstclipnode, 0, 1, + start_l, end_l, &trace); + } if (trace.allsolid) trace.startsolid = true;