Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix confusing comment in pbr example (bevyengine#16996)
# Objective After a recent fix for a panic in the pbr example (bevyengine#16976), the code contains the following comment: ```rust // This system relies on system parameters that are not available at start // Ignore parameter failures so that it will run when possible .add_systems(Update, environment_map_load_finish.never_param_warn()) ``` However, this explanation is incorrect. `EnvironmentMapLabel` is available at start. The real issue is that it is no longer available once it has been removed by `environment_map_load_finish`. ## Solution - Remove confusing/incorrect comment and `never_param_warn()`. - Make `Single<Entity, With<EnvironmentMapLabel>>` optional in `environment_map_load_finish`, and check that the entity has not yet been despawned. Since it is expected that an entity is no longer there once it has been despawned, it seems better to me to handle this case in `environment_map_load_finish`. ## Testing Ran `cargo run --example pbr`.
- Loading branch information