actor: Fixed actors clearing their position whenever they move
authorLukas Krickl <lukas@krickl.dev>
Wed, 15 Jan 2025 16:31:35 +0000 (17:31 +0100)
committerLukas Krickl <lukas@krickl.dev>
Wed, 15 Jan 2025 16:31:35 +0000 (17:31 +0100)
src/actor.s

index aa681205cb584e29838b2f3b362346039315e4d1..b19cfd01302e35ec74329244f6583691a90bbf82 100644 (file)
@@ -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