diff options
Diffstat (limited to 'src/entities/soldato.c')
-rw-r--r-- | src/entities/soldato.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/entities/soldato.c b/src/entities/soldato.c index 3f548ac..7318d5b 100644 --- a/src/entities/soldato.c +++ b/src/entities/soldato.c @@ -119,14 +119,12 @@ void updateSoldatoGuns(Game * game, Entity * entity) { if (t - data->timeSinceLastShot < SOLDATO_COOLDOWN) return; - // Shoot if in range. - if (Vector3Distance(entity->position, player->position) <= SOLDATO_GUN_MAX_RANGE) { - Bullet bullet = createBulletFromDirection(*entity, data->gunTarget, SOLDATO_BULLET_DAMAGE); - BulletHitInfo hit = shootBulletAtEntity(player, bullet); + // Shoot this fucker. + Bullet bullet = createBulletFromDirection(*entity, data->gunTarget, SOLDATO_BULLET_DAMAGE); + BulletHitInfo hit = shootBulletAtEntity(player, bullet); - if (hit.hit) - printf("This fucker hit %lf\n", t); - } + if (hit.hit) + printf("This fucker hit %lf\n", t); data->timeSinceLastShot = t; } @@ -154,12 +152,14 @@ void drawSoldato(Game * game, Entity * entity) { entityDraw(entity); // Debug gun. + /* Soldato * data = (Soldato*)entity->data; DrawLine3D( entity->position, Vector3Add(entity->position, Vector3Scale(data->gunTarget, SOLDATO_GUN_MAX_RANGE)), BLUE ); + */ /* Entity * leader; |