Skip to content

Commit

Permalink
Fix asymmetry in Q1BSP_RecursiveHullTrace
Browse files Browse the repository at this point in the history
Fixes Shpoike/Quakespasm#50.

This fixes the player being able to get through some gaps they're not meant to.
  • Loading branch information
Macil committed Feb 10, 2023
1 parent c979cc5 commit 30c5a2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Quake/r_part_fte.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ static int Q1BSP_RecursiveHullTrace (struct rhtctx_s *ctx, int num, float p1f, f
t2 = DotProduct (plane->normal, p2) - plane->dist;
}

/*if its completely on one side, resume on that side*/
if (t1 >= 0 && t2 >= 0)
/*if it's completely on one side not touching the other, resume on that side*/
if (t1 > 0 && t2 > 0)
{
num = node->children[0];
goto reenter;
Expand Down
4 changes: 2 additions & 2 deletions Quake/world.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,8 @@ static int Q1BSP_RecursiveHullTrace (struct rhtctx_s *ctx, int num, float p1f, f
t2 = DoublePrecisionDotProduct (plane->normal, p2) - plane->dist;
}

/*if its completely on one side, resume on that side*/
if (t1 >= 0 && t2 >= 0)
/*if it's completely on one side not touching the other, resume on that side*/
if (t1 > 0 && t2 > 0)
{
// return Q1BSP_RecursiveHullTrace (hull, node->children[0], p1f, p2f, p1, p2, trace);
num = node->children[0];
Expand Down

0 comments on commit 30c5a2f

Please sign in to comment.