From c649f3b0bf74804b959aa925487495d8b823f938 Mon Sep 17 00:00:00 2001 From: arngo <27396817+arngo@users.noreply.github.com> Date: Sun, 12 May 2024 17:55:35 -0400 Subject: try again --- src/bullet.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/bullet.c b/src/bullet.c index fb8def6..06e521d 100644 --- a/src/bullet.c +++ b/src/bullet.c @@ -72,11 +72,21 @@ bullet_collision_check(void) bullets[i].position.x += bullets[i].direction.x * 0.25; bullets[i].position.y += bullets[i].direction.y * 0.25; bullets[i].position.z += bullets[i].direction.z * 0.25; - Vector3 enemypos = world.players[!bullets[i].team-1].position; - if (Vector3Distance(world.players[0].position, enemypos)) + Vector3 enemypos; + if (bullets[i].team == 1) { - world.players[bullets[i].team-1].points++; - bullets[i].team = 0; + enemypos = world.players[0].position; + } + else if (bullets[i].team == 2) + { + enemypos = world.players[1].position; + } + if (bullets[i].team != 0) { + if (Vector3Distance(bullets[i].position, enemypos)) + { + world.players[bullets[i].team-1].points++; + bullets[i].team = 0; + } } } -- cgit v1.2.3