shithub: pokered

ref: f4a31b3e0b7ca89e14c4e3836f3d3ad15f38e5ce
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, [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