From f6c34057aa58b2746324b62279cfb70a78678d5d Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Fri, 3 Jan 2025 11:15:32 -0500 Subject: [PATCH] Don't update if physics is paused. --- src/visibility.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/visibility.rs b/src/visibility.rs index c016f46..e40b861 100644 --- a/src/visibility.rs +++ b/src/visibility.rs @@ -311,6 +311,7 @@ impl InputGrid for VisibilityGrid { fn update_viewshed( mut commands: Commands, + physics_time: Res>, mut viewers: Query<( Entity, &mut Viewshed, @@ -321,6 +322,9 @@ fn update_viewshed( sensors: Query<&Sensor>, spatial_query: SpatialQuery, ) { + if physics_time.is_paused() { + return; + } for (viewer_entity, mut viewshed, mut visible_entities, viewer_transform) in &mut viewers { viewshed.update( &mut commands,