door opening: Fixed animation getting stuck.
authorLukas Krickl <lukas@krickl.dev>
Mon, 11 Aug 2025 18:29:48 +0000 (20:29 +0200)
committerLukas Krickl <lukas@krickl.dev>
Mon, 11 Aug 2025 18:29:48 +0000 (20:29 +0200)
This was caused because the cf flag was never cleared if the player did not move.

src/player.s

index 89d5f6426a587618191e6954af9b4def7a91daef..92a10b516a10e0088736fe9906ae7f00e43f2433 100644 (file)
@@ -86,14 +86,16 @@ unit_player_remove_door:
        add hl, de
        ld a, [hl+] ; load y
        ld b, a
-       ld a, [hl] ; load x
+       ld a, [hl+] ; load x
        ld c, a
+       xor a, a
+       ld [hl], a ; clear cf
        call map_get_tile
        pop de
 
        ; schedule animation
        push_all
-       call objanim_door_open
+       call objanim_door_open
        pop_all
 
        ; remove door tile, door flag