diff options
author | Kaz <kazbloxmc@gmail.com> | 2020-05-28 09:05:11 -0400 |
---|---|---|
committer | Kaz <kazbloxmc@gmail.com> | 2020-05-28 09:05:11 -0400 |
commit | d673e589f63ebf56563558cc5a47f1414c289c8a (patch) | |
tree | 7fcbd6cc1c5b79e00623426d0f12d38a8e877253 /src | |
parent | 4ccbc65f4bdf0bf53b9967018eb0ad653ce28446 (diff) |
Further document agbcc's paremeter variable optimization goof.
Diffstat (limited to 'src')
-rw-r--r-- | src/use_pokeblock.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index eed092c96..6adb39871 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -683,14 +683,33 @@ static void Pokeblock_MenuWindowTextPrint(const u8 *message) Menu_PrintText(message, 1, 17); } -void Pokeblock_BufferEnhancedStatText(u8 *dest, u8 statId, s16 a2) +void Pokeblock_BufferEnhancedStatText(u8 *dest, u8 statId, s16 enhanced) { - if (a2) + if (enhanced) { - // This is is a joke. - // For absurd commentary on why this works, see battle/anim/water.c. - if (a2 > 0) a2 = 0; - if (a2 < 0) { u8 unk = -unk; } + /* + This is is a joke. One of the most absurd matches-- which may be + more real than fake! For absurd commentary on why this works, see + battle/anim/water.c, which does the same thing. + */ + if (enhanced > 0) enhanced = 0; + if (enhanced < 0) + { + /* + While "u8 var = -var" works, enhanced is an uninitialized, so + it can also be "enhanced = -enhanced". But not only can it be + "enhanced = -enhanced", it can also be + + "enhanced = [any value]" + + Rather. This was tested with the numbers 1, 5, -2, etc. As for + what may have been in the original source, it makes more sense + if enhanced had been set here. Multiple enhancement types for + Pokeblocks? Stupid error handling? + */ + u8 unk = -unk; // matches + // enhanced = any value here; // matches + } StringCopy(dest, sContestStatNames[statId]); StringAppend(dest, gOtherText_WasEnhanced); } |