From f2c00c9b49a0051ef1f293aff5aecbd315597a9e Mon Sep 17 00:00:00 2001
From: Brian Cullinan <megamindbrian@gmail.com>
Date: Wed, 11 Sep 2024 13:44:15 -0700
Subject: [PATCH] another bug in new clip stuff

---
 code/qcommon/cm_trace.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/code/qcommon/cm_trace.c b/code/qcommon/cm_trace.c
index a2e2d031e..563b8e4f8 100644
--- a/code/qcommon/cm_trace.c
+++ b/code/qcommon/cm_trace.c
@@ -1411,14 +1411,15 @@ void CM_TransformedBoxTrace( trace_t *results, const vec3_t start, const vec3_t
 #ifdef USE_BSP_MODELS
 		int j, numInlines, indexAdjusted;
 
-		// might intersect, so do an exact clip
-		indexAdjusted = CM_InlineModel (model);
-
 		// set the right map before entering trace
 		cmi = 0;
-		if(indexAdjusted < CM_NumInlineModels()) {
-
+		if(model < CM_NumInlineModels() || model == BOX_MODEL_HANDLE) {
+			indexAdjusted = model;
 		} else if (model != BOX_MODEL_HANDLE) {
+
+			// might intersect, so do an exact clip
+			indexAdjusted = CM_InlineModel (model);
+
 			for(j = 0; j < 64; j++) {
 				cmi = j;
 				numInlines = CM_NumInlineModels();