shithub: pokecrystal

Download patch

ref: 5959548c01ec36384be17224f9465287d050aff0
parent: 725148443f0ed0f70af747259ef49643359e92a2
author: Rangi <[email protected]>
date: Mon Feb 26 06:51:16 EST 2018

Document HOF Master bug (close #494)

--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -37,6 +37,9 @@
 ; day-care
 MAX_DAY_CARE_EXP EQU $500000
 
+; hall of fame
+HOF_MASTER_COUNT EQU 201
+
 ; bug-catching contest
 BUG_CONTEST_MINUTES EQU 20
 BUG_CONTEST_SECONDS EQU 0
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -33,6 +33,7 @@
 - [Magikarp length limits have a unit conversion error](#magikarp-length-limits-have-a-unit-conversion-error)
 - [Magikarp lengths can be miscalculated](#magikarp-lengths-can-be-miscalculated)
 - [Battle transitions fail to account for the enemy's level](#battle-transitions-fail-to-account-for-the-enemys-level)
+- [A "HOF Master!" title for 201-Time Famers is defined but inaccessible](#a-hof-master-title-for-201-time-famers-is-defined-but-inaccessible)
 - [Slot machine payout sound effects cut each other off](#slot-machine-payout-sound-effects-cut-each-other-off)
 - [Team Rocket battle music is not used for Executives or Scientists](#team-rocket-battle-music-is-not-used-for-executives-or-scientists)
 - [No bump noise if standing on tile `$3E`](#no-bump-noise-if-standing-on-tile-3e)
@@ -895,6 +896,24 @@
 ```
 
 *To do:* Fix this bug.
+
+
+## A "HOF Master!" title for 201-Time Famers is defined but inaccessible
+
+([Video](https://www.youtube.com/watch?v=iHkWubvxmSg))
+
+This is a bug with `HallOfFame` in [engine/events/halloffame.asm](/engine/events/halloffame.asm):
+
+```asm
+	ld hl, wHallOfFameCount
+	ld a, [hl]
+	cp HOF_MASTER_COUNT - 1 ; should be HOF_MASTER_COUNT
+	jr nc, .ok
+	inc [hl]
+.ok
+```
+
+**Fix:** Change `HOF_MASTER_COUNT - 1` to `HOF_MASTER_COUNT`.
 
 
 ## Slot machine payout sound effects cut each other off
--- a/engine/events/halloffame.asm
+++ b/engine/events/halloffame.asm
@@ -18,7 +18,7 @@
 
 	ld hl, wHallOfFameCount
 	ld a, [hl]
-	cp 200
+	cp HOF_MASTER_COUNT - 1 ; should be HOF_MASTER_COUNT
 	jr nc, .ok
 	inc [hl]
 .ok
@@ -355,7 +355,7 @@
 
 .DisplayMonAndStrings:
 ; Print the number of times the player has entered the Hall of Fame.
-; If that number is above 200, print "HOF Master!" instead.
+; If that number is at least HOF_MASTER_COUNT, print "HOF Master!" instead.
 	ld a, [wHallOfFameMonCounter]
 	cp PARTY_LENGTH
 	jr nc, .fail
@@ -376,7 +376,7 @@
 	pop hl
 	call DisplayHOFMon
 	ld a, [wHallOfFameTempWinCount]
-	cp 200 + 1
+	cp HOF_MASTER_COUNT
 	jr c, .print_num_hof
 	ld de, .HOFMaster
 	hlcoord 1, 2