unit: fixed end turn being delayed if inputs are held
authorLukas Krickl <lukas@krickl.dev>
Fri, 23 May 2025 03:57:45 +0000 (05:57 +0200)
committerLukas Krickl <lukas@krickl.dev>
Fri, 23 May 2025 03:57:45 +0000 (05:57 +0200)
src/unit.s

index 2c9219a7da28d147d0363ffdd029ab41f9c264b6..1ade05dee1b8f1cf3e81fda9f2cbd2a1b45440ed 100644 (file)
@@ -390,6 +390,10 @@ unit_sleep:
   ; inputs: 
   ;   de: current unit
 unit_next_request:
+  ld a, [gameplay_flags]
+  and a, GPF_UNIT_NEXT
+  ret nz ; do not call again if flag is set
+
   ld a, [gameplay_flags]
   or a, GPF_UNIT_NEXT
   ld [gameplay_flags], a