summaryrefslogtreecommitdiff
path: root/asm/macros
diff options
context:
space:
mode:
authorTustin2121 <tustin2121@gmail.com>2019-08-17 13:25:36 -0400
committerTustin2121 <tustin2121@gmail.com>2019-08-17 13:25:36 -0400
commitf4d4424618b8b357af23978ef543fd033dece7e9 (patch)
treefada7fdbf7ffa004acc0bbb0def5b663e5f1e22a /asm/macros
parent9bcd39d86c06882c1c17909ee72ebc2b2819254b (diff)
Folded nops into hidemoneybox and updatemoneybox
The nops are essential to the hidemoneybox and updatemoneybox commands when using vanilla versions of those commands. Even though they're not actually used parameters in the command implementation, they are still consumed, which means if someone were to get rid of the nops (as I did in TriHard) it causes the commands to consume bytecode that are not theirs, resulting in undefined behavior usually leading to softlocks. Folding the extra bytes into the macros means there's no chance of the extra bytes getting losts in scripts.
Diffstat (limited to 'asm/macros')
-rw-r--r--asm/macros/event.inc3
1 files changed, 3 insertions, 0 deletions
diff --git a/asm/macros/event.inc b/asm/macros/event.inc
index 15889b1c6..14051999f 100644
--- a/asm/macros/event.inc
+++ b/asm/macros/event.inc
@@ -1083,6 +1083,8 @@
@ Hides the secondary box spawned by showmoney.
.macro hidemoneybox
.byte 0x94
+ .byte 0 @ leftovers from ruby/sapphire. x, y params not used
+ .byte 0
.endm
@ Updates the secondary box spawned by showmoney. Consumes but does not use arguments.
@@ -1090,6 +1092,7 @@
.byte 0x95
.byte \x
.byte \y
+ .byte 0 @ 1 = don't perform this command. Always 0 in vanilla. Why this is a thing is beyond me.
.endm
@ Gets the price reduction for the index given. In FireRed, this command is a nop.