hQuotient is a four-byte buffer (fixes #558)

This commit is contained in:
Rangi
2018-08-26 13:49:38 -04:00
parent cb32c895e4
commit 557ce82073
22 changed files with 107 additions and 110 deletions

View File

@@ -1570,11 +1570,11 @@ CalcMonStatC:
jr nz, .not_hp
ld a, [wCurPartyLevel]
ld b, a
ldh a, [hQuotient + 2]
ldh a, [hQuotient + 3]
add b
ldh [hMultiplicand + 2], a
jr nc, .no_overflow_3
ldh a, [hQuotient + 1]
ldh a, [hQuotient + 2]
inc a
ldh [hMultiplicand + 1], a
@@ -1583,21 +1583,21 @@ CalcMonStatC:
.not_hp
ld b, a
ldh a, [hQuotient + 2]
ldh a, [hQuotient + 3]
add b
ldh [hMultiplicand + 2], a
jr nc, .no_overflow_4
ldh a, [hQuotient + 1]
ldh a, [hQuotient + 2]
inc a
ldh [hMultiplicand + 1], a
.no_overflow_4
ldh a, [hQuotient + 1]
ldh a, [hQuotient + 2]
cp HIGH(MAX_STAT_VALUE + 1) + 1
jr nc, .max_stat
cp HIGH(MAX_STAT_VALUE + 1)
jr c, .stat_value_okay
ldh a, [hQuotient + 2]
ldh a, [hQuotient + 3]
cp LOW(MAX_STAT_VALUE + 1)
jr c, .stat_value_okay