summaryrefslogtreecommitdiff
path: root/src/bullets.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2022-12-18 16:53:46 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2022-12-18 16:53:46 +0100
commit9eefbb4afc9601024eac6191addd98e21f90a5b3 (patch)
treee26771a2ba2d93c58940f011d8701372419f6cb8 /src/bullets.c
parent40027e44e5d0f0040238cfc1bd6a8d80c17c54fb (diff)
multithread outgoing network messages, thread safe allocator, refactor
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); }