mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Remove a documented bug that's not really a bug
I mean, technically, being able to read beyond a data table's size is bad practice, but there's so many cases of this that it's not worth mentioning. For most of these cases, at least, it's safe to assume the index won't ever get high enough to surpass such a table's length, because it's either hardcoded or decided by the game without the use of uncontrollable data. As such, they don't expose any actual bugs.
This commit is contained in:
parent
e43c89bc80
commit
a91b59ab5d
@ -55,7 +55,6 @@ These are known bugs and glitches in the original Pokémon Crystal game: code th
|
||||
- [`LoadSpriteGFX` does not limit the capacity of `UsedSprites`](#loadspritegfx-does-not-limit-the-capacity-of-usedsprites)
|
||||
- [`ChooseWildEncounter` doesn't really validate the wild Pokémon species](#choosewildencounter-doesnt-really-validate-the-wild-pokémon-species)
|
||||
- [`TryObjectEvent` arbitrary code execution](#tryobjectevent-arbitrary-code-execution)
|
||||
- [`CheckBugContestContestantFlag` can read beyond its data table](#checkbugcontestcontestantflag-can-read-beyond-its-data-table)
|
||||
- [`ClearWRAM` only clears WRAM bank 1](#clearwram-only-clears-wram-bank-1)
|
||||
|
||||
|
||||
@ -1491,35 +1490,6 @@ In [engine/overworld/events.asm](/engine/overworld/events.asm):
|
||||
```
|
||||
|
||||
|
||||
## `CheckBugContestContestantFlag` can read beyond its data table
|
||||
|
||||
In [engine/events/bug_contest/contest_2.asm](/engine/events/bug_contest/contest_2.asm):
|
||||
|
||||
```asm
|
||||
CheckBugContestContestantFlag:
|
||||
; Checks the flag of the Bug Catching Contestant whose index is loaded in a.
|
||||
|
||||
; Bug: If a >= NUM_BUG_CONTESTANTS when this is called,
|
||||
; it will read beyond the table.
|
||||
|
||||
ld hl, BugCatchingContestantEventFlagTable
|
||||
ld e, a
|
||||
ld d, 0
|
||||
add hl, de
|
||||
add hl, de
|
||||
ld e, [hl]
|
||||
inc hl
|
||||
ld d, [hl]
|
||||
ld b, CHECK_FLAG
|
||||
call EventFlagAction
|
||||
ret
|
||||
|
||||
INCLUDE "data/events/bug_contest_flags.asm"
|
||||
```
|
||||
|
||||
However, `a < NUM_BUG_CONTESTANTS` should always be true, so in practice this is not a problem.
|
||||
|
||||
|
||||
## `ClearWRAM` only clears WRAM bank 1
|
||||
|
||||
In [home/init.asm](/home/init.asm):
|
||||
|
@ -58,9 +58,6 @@ SelectRandomBugContestContestants:
|
||||
CheckBugContestContestantFlag:
|
||||
; Checks the flag of the Bug Catching Contestant whose index is loaded in a.
|
||||
|
||||
; Bug: If a >= NUM_BUG_CONTESTANTS when this is called,
|
||||
; it will read beyond the table.
|
||||
|
||||
ld hl, BugCatchingContestantEventFlagTable
|
||||
ld e, a
|
||||
ld d, 0
|
||||
|
Loading…
Reference in New Issue
Block a user