From 2487cb88890c49b15d76a949014ad1067093e181 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 10 Aug 2025 09:33:09 +0200 Subject: [PATCH] player: skipping input on the frame a door animation is triggered --- src/player.s | 10 ++++++++++ src/unit.s | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/player.s b/src/player.s index 101244f..00e4e44 100644 --- a/src/player.s +++ b/src/player.s @@ -50,6 +50,9 @@ unit_player_update: ; check if player is on a door tile ; if so, remove door and queue a map redraw and a, CF_DOOR + ; save CF_DOOR flag value to + ; return before input handling later + push af push de call nz, unit_player_remove_door pop de @@ -63,6 +66,13 @@ unit_player_update: call unit_scroll_center pop de + ; return if CF_DOOR was handeled earlier + ; and skip inputs + ; load next state in case this ret is hit + pop af + ldnull bc + ret nz + push de call unit_handle_inputs pop de diff --git a/src/unit.s b/src/unit.s index 39337c3..8148011 100644 --- a/src/unit.s +++ b/src/unit.s @@ -268,6 +268,8 @@ unit_generic_draw: ; de: actor ; hl: action table ; a: remaining moves + ; returns: + ; bc: next state unit_handle_inputs: ; push next state to the stack for now ld bc, NULL -- 2.30.2