From 40027e44e5d0f0040238cfc1bd6a8d80c17c54fb Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 18 Dec 2022 13:37:16 +0100 Subject: minor changes --- src/bullets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bullets.c') diff --git a/src/bullets.c b/src/bullets.c index 8012c83..704728e 100644 --- a/src/bullets.c +++ b/src/bullets.c @@ -182,6 +182,8 @@ static bool check_if_bullet_collided_with_ground(bullet *b, platform_window* win void clear_bullets() { for (int i = 0; i < max_bullets; i++) { + if (!bullets[i].active) continue; + bullets[i].alive_time += update_delta; if (bullets[i].alive_time >= 0.05f) { bullets[i].active = false; } @@ -213,8 +215,6 @@ void update_bullets(platform_window* window) { if (check_if_bullet_collided_with_zombie(b, window, true)) { p->kills++; } - - bullets[i].alive_time += update_delta; } } -- cgit v1.2.3-70-g09d2