From e656ef9dcefb2e0ab7480a43e75d9b2c24bc101b Mon Sep 17 00:00:00 2001 From: biglyderv Date: Mon, 25 Nov 2024 14:14:20 -0500 Subject: [PATCH] a --- common/player.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/player.js b/common/player.js index d8df448..a1b5619 100644 --- a/common/player.js +++ b/common/player.js @@ -105,12 +105,14 @@ class Player { } if (target.immortal) continue; + let oldHealth = target.health + target.health += Math.floor( (dp-0.001) * 10); target.vel.x += (target.pos.x - ent.pos.x) * 0.1; target.vel.y += (target.pos.y - ent.pos.y) * 0.1; - if (target.health == 0) { + if (target.health <= 0 && oldHealth > 0) { ent.headCount++; } }