From 30c5a2f271d344326ac246aca4b3674ab9031b2f Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Thu, 9 Feb 2023 23:30:52 -0800 Subject: [PATCH] Fix asymmetry in Q1BSP_RecursiveHullTrace Fixes https://github.com/Shpoike/Quakespasm/issues/50. This fixes the player being able to get through some gaps they're not meant to. --- Quake/r_part_fte.c | 4 ++-- Quake/world.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Quake/r_part_fte.c b/Quake/r_part_fte.c index fa39c687c..30a25f36c 100644 --- a/Quake/r_part_fte.c +++ b/Quake/r_part_fte.c @@ -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; diff --git a/Quake/world.c b/Quake/world.c index c11c43db8..b110b0fbf 100644 --- a/Quake/world.c +++ b/Quake/world.c @@ -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];