; checks if all enemies are defeated
; and re-enables scroll
map_r_enable_scroll_all_enemies_defeated:
+ ; check if all enemies are NULL actors
+ ld hl, actors_enemy
+ ld de, act_size
+ ld b, ACTS_ENEMY
+
+ xor a, a
+@check_loop:
+ ; or type into a
+ or a, [hl]
+ ret nz ; one type is not 0
+ add hl, de ; next actor
+ dec b
+ jr nz, @check_loop REL
+
ld a, [map_anim_timer]
cp a, 0
jp z, @no_animation
- ; TODO
call map_arrow_indicator
+
+ ld a, [map_anim_timer]
+ cp a, 0
+ ret nz ; if timer is not 0 do not set scroll
+
+ ; re-enable scroll
+ ld a, [game_flags]
+ and a, ~GPF_NO_SCROLL & 0xFF
+ ld [game_flags], a
ret
@no_animation: