aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-09-30 22:29:45 +1000
committerquou <quou@disroot.org>2024-09-30 22:30:05 +1000
commitfbc6770df9234bf89b5e4fe3ae07af6f3ab96281 (patch)
treea5addd7dd8a032b7ea9cd5b97a80e91e5cd13480
parent18468a0ae82adddd9973ae8b16a9d55dce61dbdb (diff)
update deathzones first
-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) {