From 979898814132291b829cd3c45232f836090a34be Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 22 Feb 2022 16:24:39 -0600 Subject: [PATCH] Minor cleanup. --- src/visibility.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/visibility.rs b/src/visibility.rs index 9332b6b..754dcc9 100644 --- a/src/visibility.rs +++ b/src/visibility.rs @@ -44,6 +44,7 @@ impl Viewshed { pub fn is_point_visible(&self, point: &dyn PointLike) -> bool { self.visible_points.contains(&point.into()) } + fn update( &mut self, viewer_entity: &Entity, @@ -79,7 +80,7 @@ impl Viewshed { let mut entities = HashSet::new(); let shape_pos = (Vec2::new(coord.x as f32 + 0.5, coord.y as f32 + 0.5), 0.); let dest = point!(coord.x as f32 + 0.5, coord.y as f32 + 0.5); - if na::distance(&origin, &dest) >= self.range as f32 { + if na::distance(&origin, &dest) > self.range as f32 { return u8::MAX; } let mut opacity = 0;