shithub: pokered

ref: b9a113a9f4712771e37313a4c8a76f7ef23cebb2
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:
	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