Don't update if physics is paused.

This commit is contained in:
Nolan Darilek 2025-01-03 11:15:32 -05:00
parent 34613bfe07
commit f6c34057aa

View File

@ -311,6 +311,7 @@ impl InputGrid for VisibilityGrid {
fn update_viewshed(
mut commands: Commands,
physics_time: Res<Time<Physics>>,
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,