Only count laser hits once.

This commit is contained in:
Steve 2018-03-03 07:41:05 +00:00
parent f634a28127
commit 0c2f069fef
2 changed files with 3 additions and 1 deletions

View File

@ -141,6 +141,7 @@ enum
#define EF_ALWAYS_PROCESS (2 << 16) #define EF_ALWAYS_PROCESS (2 << 16)
#define EF_NO_TELEPORT (2 << 17) #define EF_NO_TELEPORT (2 << 17)
#define EF_NO_OBSERVE (2 << 18) #define EF_NO_OBSERVE (2 << 18)
#define EF_BULLET_HIT (2 << 19)
#define GRAVITY_POWER 0.5f #define GRAVITY_POWER 0.5f
#define FRICTION 0.75f #define FRICTION 0.75f

View File

@ -72,8 +72,9 @@ static void touch(Entity *other)
other->applyDamage(2); other->applyDamage(2);
swapSelf(other); 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]++; game.stats[STAT_SHOTS_HIT]++;
} }