This makes it so the room is only uncovered when the animation finishes.
; inputs:
; a: tile flags
; b: tile index
+ ; c: previous player rt special flags
; de: actor
objanim_door_open:
push de
pop de
ld hl, act_pos_y
add hl, de ; hl = act y pos
-
-
- xor a, a
+
+ ; save palyer rt flags in flags
+ ; but invert CF_COVERED
+ ld a, c
ld de, objanim+obja_flags
ld [de], a
inc de ; de = y pos
objanim_door_open_fn:
#define TMP_Y, scratch
#define TMP_X, scratch+1
+
call load_unit_obj
ld de, objanim+st_size
; de = anim flags
; set first object
+ ; reload rt flags from backup while the animation is playing
+ ld a, [de]
+ ld [player_rt_special_flags], a
inc de ; skip flags
ld a, [de] ; a = y position
inc de ; de = x postion
and a, CF_COVERED
ld b, a
ld a, [player_rt_special_flags]
+ ld c, a ; remove door might needs this in c
and a, (~CF_COVERED) & 0xFF
or a, b
ld [player_rt_special_flags], a