summaryrefslogtreecommitdiff
path: root/src/bullets.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bullets.c')
-rw-r--r--src/bullets.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bullets.c b/src/bullets.c
index 704728e..ed9aab4 100644
--- a/src/bullets.c
+++ b/src/bullets.c
@@ -226,6 +226,13 @@ void draw_bullets(platform_window* window) {
bullet b = bullets[i];
if (!b.active) continue;
+ if (b.player_id == player_id) {
+ player *p = get_player_by_id(b.player_id);
+ b.position.x = p->gunx;
+ b.position.y = p->guny;
+ b.position.z = p->gun_height;
+ }
+
if ((int)bullets[i].position.y < (int)bullets[i].endy) { BULLET_RENDER_DEPTH((int)bullets[i].position.y); }
else { BULLET_RENDER_DEPTH((int)bullets[i].endy); }