call map_get_tile
cp a, 0x00 ; we want no flags here
pop bc
- jr z, @try_placement_again REL
+ jr nz, @try_placement_again REL
+
+ push bc
+ ; test if a unit is here
+ call unit_find_at
+ ld a, h
+ or a, l
+ pop bc
+ jp nz, @try_placement_again REL
; otherwise write position
ld hl, player_unit
ld de, act_pos_y
add hl, de
ld a, b
- ;ld [hl+], a ; write y
+ ld [hl+], a ; write y
ld a, c
- ;ld [hl], a ; write x
+ ld [hl], a ; write x
+
+ ld de, player_unit
+ call unit_scroll_center
ret