diff options
author | quou <quou@disroot.org> | 2024-09-30 22:29:45 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-09-30 22:30:05 +1000 |
commit | fbc6770df9234bf89b5e4fe3ae07af6f3ab96281 (patch) | |
tree | a5addd7dd8a032b7ea9cd5b97a80e91e5cd13480 | |
parent | 18468a0ae82adddd9973ae8b16a9d55dce61dbdb (diff) |
update deathzones first
-rw-r--r-- | world.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) { |