Skip to content

Commit a20da4c

Browse files
authored
Fix adding outline when SceneSpawner is not in the world (#74)
1 parent 4a2ddc4 commit a20da4c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/scene.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ fn add_outline(
4141
mut commands: Commands,
4242
mut query: Query<(&mut AsyncSceneInheritOutline, Option<&SceneInstance>)>,
4343
systems: Res<AsyncSceneInheritOutlineSystems>,
44-
scene_spawner: Res<SceneSpawner>,
44+
scene_spawner: Option<Res<SceneSpawner>>, // Could be temporarily removed from the world when a scene is spawning
4545
) {
4646
let Ok((mut scene_outline, scene_instance)) = query.get_mut(*entity_input) else {
4747
return;
4848
};
4949
let mut ready = false;
50-
if let Some(scene_instance) = scene_instance {
50+
if let (Some(scene_instance), Some(scene_spawner)) = (scene_instance, scene_spawner) {
5151
let iid = **scene_instance;
5252
if scene_spawner.instance_is_ready(iid) {
5353
for child in scene_spawner.iter_instance_entities(iid) {

0 commit comments

Comments
 (0)