aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--world.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/world.c b/world.c
index aba9bfb..2b6187e 100644
--- a/world.c
+++ b/world.c
@@ -53,6 +53,9 @@ Deathzone* inst_deathzone(
void update_world(World* w, const App* a) {
int i;
+ for (i = w->deathzone_count - 1; i >= 0; i--)
+ 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]))
@@ -60,9 +63,6 @@ void update_world(World* w, const App* a) {
for (i = w->enemy_count - 1; i >= 0; i--)
if (update_enemy(&w->enemies[i], w))
w->enemies[i] = w->enemies[--w->enemy_count];
- for (i = w->deathzone_count - 1; i >= 0; i--)
- if (update_deathzone(&w->deathzones[i]))
- w->deathzones[i] = w->deathzones[--w->deathzone_count];
}
void ren_world(const World* w, struct Renderer* r) {