opti(particles): fetch ThreadRng only once in a system

This commit is contained in:
Pascal Engélibert 2022-08-27 09:35:01 +02:00
commit 9f04ec861e
Signed by: tuxmain
GPG key ID: 3504BC6D362F7DCA
2 changed files with 18 additions and 10 deletions

View file

@ -290,8 +290,7 @@ fn collision_event_system(
.clamp(Vec4::ZERO, Vec4::ONE);
// If color approximately white
if app_state.current() == &AppState::Game
&& new_color.min_element() >= 0.9
if app_state.current() == &AppState::Game && new_color.min_element() >= 0.9
{
app_state.replace(AppState::Win).ok();
}