diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-18 13:37:16 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-18 13:37:16 +0100 |
| commit | 40027e44e5d0f0040238cfc1bd6a8d80c17c54fb (patch) | |
| tree | 98206731b8a27885d212333ef7b593ab664f5148 /src/bullets.c | |
| parent | 1ac44d4ec6b6b51fefe6ca50ef82d5d2fc1f6dfb (diff) | |
minor changes
Diffstat (limited to 'src/bullets.c')
| -rw-r--r-- | src/bullets.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; } } |
