aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-10-02 21:24:01 +1000
committerquou <quou@disroot.org>2024-10-02 21:24:40 +1000
commit5da85053f4d4116c3190a8f45194040ac10baf92 (patch)
tree4f26c91d0501bcbf9968eb9647478a05063ac182
parent8d2ba1419c060078c0aeeb33ef4e84da482b78f5 (diff)
update particle effects while the world is frozen
-rw-r--r--world.c6
1 files 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];