Cleanup
This commit is contained in:
@@ -71,10 +71,9 @@ impl CollisionWorld {
|
||||
pub fn trace(&self, start: [f32; 3], end: [f32; 3], half: [f32; 3]) -> Option<Hit> {
|
||||
let mut nearest: Option<Hit> = None;
|
||||
for b in &self.brushes {
|
||||
if let Some(h) = trace_brush(b, start, end, half) {
|
||||
if nearest.as_ref().map_or(true, |n| h.frac < n.frac) {
|
||||
nearest = Some(h);
|
||||
}
|
||||
if let Some(h) = trace_brush(b, start, end, half)
|
||||
&& nearest.as_ref().is_none_or(|n| h.frac < n.frac) {
|
||||
nearest = Some(h);
|
||||
}
|
||||
}
|
||||
nearest
|
||||
|
||||
Reference in New Issue
Block a user