Minor cleanup.

This commit is contained in:
Nolan Darilek 2022-02-22 16:24:39 -06:00
parent dee62d2dca
commit 9798988141

View File

@ -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;