shithub: pokecrystal

Download patch

ref: 6718981fb12b579a3ecb13b5ff01ce730514af52
parent: 21708a2271974e35cbb3eb41fe219a49d7d40ae9
author: yenatch <[email protected]>
date: Tue Jun 3 12:34:21 EDT 2014

Truncate MAX_LEVEL + 1 if it exceeds 8 bits.

If MAX_LEVEL was set to 255, the value could not fit into a byte.

--- a/main.asm
+++ b/main.asm
@@ -61186,7 +61186,7 @@
 .asm_50e26
 	inc d
 	ld a, d
-	cp MAX_LEVEL + 1
+	cp (MAX_LEVEL + 1) % $100
 	jr z, .asm_50e45
 	call Function50e47
 	push hl