shithub: pokered

Download patch

ref: 084c8407d879e114453147b737528da46f3b1cb5
parent: b65c6e815643a1cbce8c7c3cd48fc9881bb56d01
author: U-Daniel-PC\Daniel <corrnondacqb@yahoo.com>
date: Thu Feb 19 19:56:30 EST 2015

Remove hard-coded wPokedexOwned/wPokedexSeen array size

--- a/engine/menu/pokedex.asm
+++ b/engine/menu/pokedex.asm
@@ -194,7 +194,7 @@
 	call PlaceString
 ; find the highest pokedex number among the pokemon the player has seen
 	ld hl,wPokedexSeenEnd - 1
-	ld b,153
+	ld b,(wPokedexSeenEnd - wPokedexSeen) * 8 + 1
 .maxSeenPokemonLoop
 	ld a,[hld]
 	ld c,8
--- a/scripts/oakslab.asm
+++ b/scripts/oakslab.asm
@@ -944,7 +944,7 @@
 	bit 6, a
 	jr nz, .asm_50e81 ; 0x1d24e
 	ld hl, wPokedexOwned
-	ld b, $13
+	ld b, wPokedexOwnedEnd - wPokedexOwned
 	call CountSetBits
 	ld a, [wd11e]
 	cp $2