From 56702351ac20991778a182eb64714efaab08880c Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Wed, 9 Oct 2024 06:02:02 +0200 Subject: [PATCH] take damage code is now only run when the player is not in iframe mode --- src/player.s | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/player.s b/src/player.s index 3b39871..7a1ed33 100644 --- a/src/player.s +++ b/src/player.s @@ -273,6 +273,16 @@ player_use_resource: player_take_damage: ld [tmp], a ; tmp store a + ; if iframes are on, do nothing + push hl + ld de, player_timer_i ; go to timer + add hl, de + ld a, [hl] ; load timer into a + pop hl ; back to base + cp a, 0 + ret nz + + ; set damage anim timer ld a, DAMAGE_ANIM_LEN ld [damage_anim], a -- 2.30.2