aboutsummaryrefslogtreecommitdiff
path: root/enemy.c
diff options
context:
space:
mode:
Diffstat (limited to 'enemy.c')
-rw-r--r--enemy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/enemy.c b/enemy.c
index 04baec4..60366fb 100644
--- a/enemy.c
+++ b/enemy.c
@@ -105,6 +105,7 @@ void enemy_system(World* world) {
enemy = &world->enemies[i];
if (enemy->hp <= 0) {
destroy_entity(world, i);
+ world->enemies_killed++;
if ((bits & ctype_position) && (bits & ctype_skull)) {
pos = &world->positions[i];
@@ -130,7 +131,7 @@ void enemy_system(World* world) {
dpy = ((ppos->y - pos->y) >> 4) + 256;
tpx = dpx;
tpy = dpy;
- d = ((dpx * dpx) >> fbits) + ((dpy * dpy) >> fbits);
+ d = ((dpx * dpx) + (dpy * dpy)) >> fbits;
if (enemy->being_damaged) {
enemy->being_damaged--;