shithub: pokered

Download patch

ref: d8d0893d94e652c8c5ebf347498e86a369bf1051
parent: b65c6e815643a1cbce8c7c3cd48fc9881bb56d01
parent: 084c8407d879e114453147b737528da46f3b1cb5
author: Daniel Harding <corrnondacqb@yahoo.com>
date: Thu Feb 19 20:19:55 EST 2015

Merge pull request #80 from dannye/master

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