PokecenterCheck:
	set #1, MAP_GROUP_OFFSET
	call GetGameDataPointer
	seek #result
	getfilehalfword #result
	set #address, .pokecenters
.loop
	gethalfwordinc #temp, #address
	ifeq #temp, #zero, .not_in_pokecenter
	ifne #temp, #result, .loop
	return
.not_in_pokecenter
	print .not_in_pokecenter_string
	menu #result, YesNoMenu
	retz #result
	exit #result

.not_in_pokecenter_string
	string "You are not currently inside a Pokémon Center. Remember that, in order to ensure patching is successful, you should be inside a Pokémon Center when patching your savefile and exit it immediately when you continue the game. Do you want to continue patching anyway?"

.pokecenters
	; map group, map number
	db  2,  2 ;Caper
	db  3,  2 ;Oxalis
	db  4,  2 ;Spurge
	db  6,  2 ;Laurel
	db  7,  2 ;Torenia
	db  8,  5 ;Phacelia
	db  9,  2 ;Saxifrage
	db 10,  2 ;Phlox
	db 11,  2 ;Acania
	db 21,  2 ;Route 77
	db 25,  3 ;Route 81
	db 44,  4 ;Merson
	db 45, 10 ;Hayward
	db 46,  5 ;Owsauri
	db 47,  6 ;Moraga
	db 48,  4 ;Jaeru
	db 49,  3 ;Botan
	db 50,  6 ;Castro
	db 51,  7 ;Eagulou
	db 73,  2 ;Route 67
	db 81,  2 ;Azalea
	db 84,  4 ;Goldenrod
	db 85,  2 ;Saffron
	db 89,  5 ;Southerly
	dh 0
