From 5749d763546e6d79d6d40c7bcedf757de1280fb7 Mon Sep 17 00:00:00 2001
From: Quaternions <krakow20@gmail.com>
Date: Wed, 26 Feb 2025 10:16:48 -0800
Subject: [PATCH] bsp_loader: they actually use the texture to inform behaviour

---
 lib/bsp_loader/src/brush.rs | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/bsp_loader/src/brush.rs b/lib/bsp_loader/src/brush.rs
index dfda628..169dbef 100644
--- a/lib/bsp_loader/src/brush.rs
+++ b/lib/bsp_loader/src/brush.rs
@@ -237,6 +237,15 @@ pub fn brush_to_mesh(bsp:&vbsp::Bsp,brush:&vbsp::Brush)->Result<model::Mesh,Brus
 	let sides_range=brush_start_idx..brush_start_idx+brush.num_brush_sides as usize;
 	let sides=bsp.brush_sides.get(sides_range).ok_or(BrushToMeshError::SliceBrushSides)?;
 	let face_list=sides.iter().map(|side|{
+		// The so-called tumor brushes are actually visleaf hints
+		// used to inform the bsp of how to paritition space
+		if let Some(texture_info)=bsp.textures_info.get(side.texture_info as usize){
+			let texture_info=vbsp::Handle::new(bsp,texture_info);
+			// I cannot believe they actually use the texture to inform behaviour
+			if matches!(texture_info.name().to_lowercase().as_str(),"tools/toolshint"|"tools/toolsskip"){
+				return None;
+			}
+		}
 		let plane=bsp.plane(side.plane as usize)?;
 		Some(Face{
 			normal:valve_transform_normal(plane.normal.into()),