diff --git a/src/defs.h b/src/defs.h index 1cc82ca..7754bed 100644 --- a/src/defs.h +++ b/src/defs.h @@ -141,6 +141,7 @@ enum #define EF_ALWAYS_PROCESS (2 << 16) #define EF_NO_TELEPORT (2 << 17) #define EF_NO_OBSERVE (2 << 18) +#define EF_BULLET_HIT (2 << 19) #define GRAVITY_POWER 0.5f #define FRICTION 0.75f diff --git a/src/entities/bullets/laser.c b/src/entities/bullets/laser.c index d35c91a..51efd70 100644 --- a/src/entities/bullets/laser.c +++ b/src/entities/bullets/laser.c @@ -72,8 +72,9 @@ static void touch(Entity *other) other->applyDamage(2); swapSelf(other); - if (b->owner->type == world.bob->type && (other->type == ET_ENEMY || other->type == ET_BOSS || other->type == ET_DESTRUCTABLE)) + if (!(b->flags & EF_BULLET_HIT) && b->owner->type == world.bob->type && (other->type == ET_ENEMY || other->type == ET_BOSS || other->type == ET_DESTRUCTABLE)) { + b->flags |= EF_BULLET_HIT; game.stats[STAT_SHOTS_HIT]++; }