From: Lukas Krickl Date: Tue, 20 May 2025 13:16:27 +0000 (+0200) Subject: unit: units now mark the correct unit as active X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=a983d1fb208c92aed0d5a44320cbbd6c83e9773d;p=gbrg%2F.git unit: units now mark the correct unit as active --- diff --git a/src/map.s b/src/map.s index b103d87..493d685 100644 --- a/src/map.s +++ b/src/map.s @@ -113,9 +113,8 @@ map_load_demo_actors: ld hl, p0_units + act_size ld bc, act_size call memcpy - + call unit_next_no_current - call ui_unit_need_draw ret diff --git a/src/ui.s b/src/ui.s index e3d2882..e475349 100644 --- a/src/ui.s +++ b/src/ui.s @@ -8,6 +8,8 @@ ui_init: ret ; schedules a unit draw + ; sets draw flag for UI + ; and sets current unit as ui_draw_actor ; inputs: ; de: unit ui_unit_need_draw: diff --git a/src/unit.s b/src/unit.s index 564dcb6..66bc157 100644 --- a/src/unit.s +++ b/src/unit.s @@ -42,7 +42,6 @@ units_update: ret unit_demo_1_init: - call ui_unit_need_draw ldnull bc ret @@ -447,8 +446,11 @@ unit_next_no_current: ld a, [unit_next_best_act_ptr+1] ld [ui_draw_actor+1], a ld d, a - call unit_switch_to_active + push de + call unit_switch_to_active + pop de + call ui_unit_need_draw ret @retry: @@ -487,7 +489,7 @@ unit_demo_1: unit_demo_2: st_def 0x00, unit_demo_1_init, st_unit_demo_1_idle - act_def ACT_T_DEMO_1, 0, 1, 2, 3, 4, 5, 3, 3, 0 + act_def ACT_T_DEMO_1, 0, 1, 2, 3, 4, 7, 3, 3, 0 act_st_def NULL, NULL, st_unit_demo_1_update, st_unit_demo_1_idle st_unit_demo_1_update: