shithub: pokered

ref: 6057f285ad1a930315d1a45fa3d1aa08efe6801d
dir: /engine/overworld/is_player_just_outside_map.asm/

View raw version
; 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