summaryrefslogtreecommitdiff
path: root/src/bullets.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2023-10-29 16:53:33 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2023-10-29 16:53:33 +0100
commit04024078984bbaf84f34352061da2a224ecdb0b0 (patch)
treee576cdd0451e06d96c71131c551b1bc32d633f0d /src/bullets.c
parent61c5fb1e253f31d2faa3a0fc970ce4e18f32b205 (diff)
fix throwable collision
Diffstat (limited to 'src/bullets.c')
-rw-r--r--src/bullets.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bullets.c b/src/bullets.c
index a3a876e..ed7ca58 100644
--- a/src/bullets.c
+++ b/src/bullets.c
@@ -21,7 +21,9 @@ void shoot(platform_window* window, u32 id, float dirx, float diry) {
if (bullets_to_shoot > p->ammo_in_mag) bullets_to_shoot = p->ammo_in_mag;
p->ammo_in_mag -= bullets_to_shoot;
- add_audio_event_to_queue(EVENT_SHOOT, p->id, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height});
+ if (bullets_to_shoot > 0) {
+ add_audio_event_to_queue(EVENT_SHOOT, p->id, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height});
+ }
for (int i = 0; i < bullets_to_shoot; i++)
{