Skip to content

Commit

Permalink
Use SERIAL_RNS_LENGTH in _BattleRandom
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Dec 22, 2024
1 parent 26e9de5 commit cbfd48b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/battle/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6900,7 +6900,7 @@ _BattleRandom::
ld [wLinkBattleRNCount], a

; If we haven't hit the end yet, we're good
cp 10 - 1 ; Exclude last value. See the closing comment
cp SERIAL_RNS_LENGTH - 1 ; Exclude last value. See the closing comment
ld a, [hl]
pop bc
pop hl
Expand All @@ -6916,7 +6916,7 @@ _BattleRandom::
xor a
ld [wLinkBattleRNCount], a
ld hl, wLinkBattleRNs
ld b, 10 ; number of seeds
ld b, SERIAL_RNS_LENGTH ; number of seeds

; Generate next number in the sequence for each seed
; a[n+1] = (a[n] * 5 + 1) % 256
Expand Down

0 comments on commit cbfd48b

Please sign in to comment.