From f4d4424618b8b357af23978ef543fd033dece7e9 Mon Sep 17 00:00:00 2001 From: Tustin2121 Date: Sat, 17 Aug 2019 13:25:36 -0400 Subject: 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. --- asm/macros/event.inc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'asm') 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. -- cgit v1.2.3