Fixed bug that overwrote de when taking damage
authorLukas Krickl <lukas@krickl.dev>
Tue, 8 Oct 2024 05:16:22 +0000 (07:16 +0200)
committerLukas Krickl <lukas@krickl.dev>
Tue, 8 Oct 2024 05:16:22 +0000 (07:16 +0200)
src/player.s

index e5076ab322c9a87bc6c35789fe570009a5118260..bc8d1e603117449dc085f03aeadd817f5a41f608 100644 (file)
@@ -110,11 +110,13 @@ player_update:
   ; make sure we do not mess with hl
   push hl
   ; hl = player_x right now 
-  dec hl ; hl = player_y == player_base 
+  dec hl ; hl = player_y == player_base
+  push de ; de will get used in take damage
   call player_take_damage
   ; call for UI redraw 
   ld a, UI_REDRAW_HP 
   ld [ui_flags], a
+  pop de
   pop hl
 @nota: