summaryrefslogtreecommitdiff
path: root/engine/overworld/is_player_just_outside_map.asm
blob: e9ba204a6222e0d81aa4e50b5551dcc75d4fcf7c (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, [wYCoord]
	ld b, a
	ld a, [wCurMapHeight]
	call .compareCoordWithMapDimension
	ret z
	ld a, [wXCoord]
	ld b, a
	ld a, [wCurMapWidth]
.compareCoordWithMapDimension
	add a
	cp b
	ret z
	inc b
	ret