summaryrefslogtreecommitdiff
path: root/engine/overworld/is_player_just_outside_map.asm
blob: 24e434b3a030cc5321a5481b88152d980f12356e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
; returns whether the player is one tile outside the map in Z
IsPlayerJustOutsideMap: ; 128d8 (4:68d8)
	ld a, [W_YCOORD]
	ld b, a
	ld a, [W_CURMAPHEIGHT]
	call .compareCoordWithMapDimension
	ret z
	ld a, [W_XCOORD]
	ld b, a
	ld a, [W_CURMAPWIDTH]
.compareCoordWithMapDimension
	add a
	cp b
	ret z
	inc b
	ret