From 14dd9c4cd8bff104cf7d5fab1c3aa7a5e648f10b Mon Sep 17 00:00:00 2001
From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Sun, 23 Apr 2017 22:20:45 +0000
Subject: [PATCH] Fix a bug in collisions between brushes and brushes when the
 plane is rotating - this case is never used currently but it's definitely a
 bug worth fixing.

Thanks to Eduard Elin for the bug report.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12331 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=220d6cb7e084a11a1c8f99b0fd57c522e17d6cef
---
 collision.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/collision.c b/collision.c
index 827200ef..c9cfc976 100644
--- a/collision.c
+++ b/collision.c
@@ -646,7 +646,7 @@ void Collision_TraceBrushBrushFloat(trace_t *trace, const colbrushf_t *trace_sta
 			VectorNormalize(endplane);
 		}
 		startplane[3] = furthestplanedist_float(startplane, other_start->points, othernumpoints);
-		endplane[3] = furthestplanedist_float(startplane, other_end->points, othernumpoints);
+		endplane[3] = furthestplanedist_float(endplane, other_end->points, othernumpoints);
 		startdist = nearestplanedist_float(startplane, trace_start->points, tracenumpoints) - startplane[3];
 		enddist = nearestplanedist_float(endplane, trace_end->points, tracenumpoints) - endplane[3];
 		//Con_Printf("%c%i: startdist = %f, enddist = %f, startdist / (startdist - enddist) = %f\n", nplane2 != nplane ? 'b' : 'a', nplane2, startdist, enddist, startdist / (startdist - enddist));
-- 
2.39.5