summaryrefslogtreecommitdiffhomepage
path: root/src/bullet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bullet.c')
-rw-r--r--src/bullet.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bullet.c b/src/bullet.c
index d891d8b..6fca87e 100644
--- a/src/bullet.c
+++ b/src/bullet.c
@@ -76,15 +76,18 @@ bullet_collision_check(void)
if (bullets[i].team == 1)
{
enemypos = world.players[1].position;
+ if (Vector3Distance(bullets[i].position, enemypos) < 1)
+ {
+ world.players[0].points++;
+ bullets[i].team = 0;
+ }
}
else if (bullets[i].team == 2)
{
enemypos = world.players[0].position;
- }
- if (bullets[i].team != 0) {
- if (Vector3Distance(bullets[i].position, enemypos))
+ if (Vector3Distance(bullets[i].position, enemypos) < 1)
{
- world.players[bullets[i].team-1].points++;
+ world.players[1].points++;
bullets[i].team = 0;
}
}