Skip to content

Commit 96dc170

Browse files
committed
Check if player is dead even when damage isn't taken
1 parent db413d7 commit 96dc170

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

enemy.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ def attack(self, dmg: int, times: int, target: Player):
218218
target.block = 0
219219
target.health -= dmg
220220
bus.publish(Message.ON_PLAYER_HEALTH_LOSS, None)
221-
if target.health <= 0:
222-
target.die()
221+
if target.health <= 0:
222+
target.die()
223223
bus.publish(Message.AFTER_ATTACK, (self, target, dmg))
224224
sleep(1)
225225

0 commit comments

Comments
 (0)