From 88e99409fa04c1d84cece7cfed720bc2b43ce47c Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Wed, 15 Jan 2025 17:31:35 +0100 Subject: [PATCH] actor: Fixed actors clearing their position whenever they move --- src/actor.s | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/actor.s b/src/actor.s index aa68120..b19cfd0 100644 --- a/src/actor.s +++ b/src/actor.s @@ -168,7 +168,9 @@ actor_anim_verify: pop bc ret z + push af call anim_clear + pop af ret ; truncates the position @@ -195,11 +197,11 @@ anim_truncate_pos: actor_tile_update_rf_flags: push_all - ; first unset existing flags + inc bc ; bc = y pos - ; add +8 to positions to center on tile + ; first unset existing flags - inc bc ; bc = y pos + ; sub 8 to positions to center on tile ld a, [bc] sub a, ANIM_MOVE_TILE_SIZE / 2 ; -8 to be in center ld d, a ; d = y pos @@ -229,6 +231,7 @@ actor_tile_update_rf_flags: or a, RF_ACTOR ld [hl], a +@skip: pop_all ret -- 2.30.2