Fixed a bug that caused the tile loader to break when the tile struct is
modified.
push de
call map_get_tile
; hl = tile
- ld de, t_flags
+ ld de, t_flags0
add hl, de
ld a, [hl]
ld b, a ; b = tile flags
.de TT_EMPTY, 1
.de TT_WALL, 1
- ; tile flags
+ ; tile flags0
.se 1
; SOUTH EXIT
.de TF_SE, 1
; tile struct
.se 0
-.de t_type, 1
-.de t_flags, 1
+.de t_type, 1
+ ; flags0: exit and lock related flags
+ ; the lower 4 bits are exit directions
+ ; the upper 4 bits indicate if the exit is locked
+ ; locked doors may be forced open by attacking,
+ ; lockpicked or opened with a key
+.de t_flags0, 1
+ ; flags1: tile type related flags (e.g. lava)
+.de t_flags1, 1
; actor currently
; standing on tile (ptr)
.de t_act, 2
; hl = first tile to load
; hl = first tile in buffer
- ld de, tiles+t_flags ; load flags
+ ld de, tiles+t_flags0 ; load flags
ld bc, MAP_TILES ; loop counter
@load_loop:
ld [de], a ; write flags
; next tile
- inc de
- inc de
- inc de
- inc de
- inc de
- inc de
- inc de
+.rep i, t_size, 1, inc de
; loop counter--
dec bc