From 5da85053f4d4116c3190a8f45194040ac10baf92 Mon Sep 17 00:00:00 2001 From: quou Date: Wed, 2 Oct 2024 21:24:01 +1000 Subject: update particle effects while the world is frozen --- world.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/world.c b/world.c index 1881df2..94aa1c7 100644 --- a/world.c +++ b/world.c @@ -73,6 +73,9 @@ void update_world(World* w, const App* a) { int i; if (w->laser.life) update_laser(&w->laser); + for (i = w->particle_count - 1; i >= 0; i--) + if (update_particle(&w->particles[i])) + w->particles[i] = w->particles[--w->particle_count]; if (w->freeze) { w->freeze--; return; @@ -81,9 +84,6 @@ void update_world(World* w, const App* a) { if (update_deathzone(&w->deathzones[i])) w->deathzones[i] = w->deathzones[--w->deathzone_count]; update_player(&w->player, w, a, &w->map); - for (i = w->particle_count - 1; i >= 0; i--) - if (update_particle(&w->particles[i])) - w->particles[i] = w->particles[--w->particle_count]; for (i = w->effect_count - 1; i >= 0; i--) if (update_effect(&w->effects[i])) w->effects[i] = w->effects[--w->effect_count]; -- cgit v1.2.3-54-g00ecf