From c1286c2fe2e40dc1070076ef2c69b67d07c8b867 Mon Sep 17 00:00:00 2001 From: PokeCodec <67983839+PokeCodec@users.noreply.github.com> Date: Thu, 10 Sep 2020 18:07:46 -0400 Subject: [PATCH] Change according to feedback --- src/battle_script_commands.c | 3 ++- src/berry_crush.c | 37 +++++++++++++++++------------------- src/dewford_trend.c | 15 +-------------- 3 files changed, 20 insertions(+), 35 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c9e32b8d2..fca2b3879 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4650,7 +4650,8 @@ static void Cmd_switchinanim(void) static void Cmd_jumpifcantswitch(void) { - s32 i, lastMonId; + s32 i; + s32 lastMonId; struct Pokemon *party; gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(SWITCH_IGNORE_ESCAPE_PREVENTION)); diff --git a/src/berry_crush.c b/src/berry_crush.c index 48b63b90c..2175d2abb 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -215,7 +215,7 @@ void sub_8022524(struct BerryCrushGame_138 *, u16); void sub_8022B28(struct Sprite *); void sub_8022554(struct BerryCrushGame_138 *r0); void sub_8024578(struct BerryCrushGame *); -void sub_8024644(u8 *, u32, u32, u32, u32); +void sub_8024644(u8 *, u8, u8, u16, u8); static void sub_8022A20(struct Sprite *sprite); static u32 BerryCrushCommand_BeginNormalPaletteFade(struct BerryCrushGame *r6, u8 *r1); static u32 sub_8022CB0(struct BerryCrushGame *r4, u8 *r5); @@ -2000,23 +2000,23 @@ static u32 BerryCrushCommand_BeginNormalPaletteFade(struct BerryCrushGame *game, u32 selectedPals[2]; selectedPals[0] = (u32)params[0]; - selectedPals[1] = (u32)params[1]; - selectedPals[1] <<= 8; + selectedPals[1] = (u32)params[1]; + selectedPals[1] <<= 8; - selectedPals[0] |= selectedPals[1]; - selectedPals[1] = (u32)params[2]; - selectedPals[1] <<= 16; + selectedPals[0] |= selectedPals[1]; + selectedPals[1] = (u32)params[2]; + selectedPals[1] <<= 16; - selectedPals[0] |= selectedPals[1]; - selectedPals[1] = (u32)params[3]; - selectedPals[1] <<= 24; + selectedPals[0] |= selectedPals[1]; + selectedPals[1] = (u32)params[3]; + selectedPals[1] <<= 24; - selectedPals[0] |= selectedPals[1]; - params[0] = params[9]; + selectedPals[0] |= selectedPals[1]; + params[0] = params[9]; - color = params[8]; - color <<= 8; - color |= params[7]; + color = params[8]; + color <<= 8; + color |= params[7]; gPaletteFade.bufferTransferDisabled = FALSE; BeginNormalPaletteFade(selectedPals[0], params[4], params[5], params[6], color); @@ -3281,14 +3281,11 @@ static void BerryCrush_SetPaletteFadeParams(u8 *params, bool8 communicateAfter, params[9] = communicateAfter; } -void sub_8024644(u8 *r0, u32 r1, u32 r2, u32 r3, u32 r5) +void sub_8024644(u8 *r0, u8 r1, u8 r2, u16 r3, u8 r5) { - u8 sp[2]; - - 0[(u16 *)sp] = r3; r0[0] = r1; r0[1] = r2; - r0[2] = sp[0]; - r0[3] = sp[1]; + r0[2] = ((u8 *)&r3)[0]; + r0[3] = ((u8 *)&r3)[1]; r0[4] = r5; } diff --git a/src/dewford_trend.c b/src/dewford_trend.c index 392a880ae..e0063ec1b 100644 --- a/src/dewford_trend.c +++ b/src/dewford_trend.c @@ -219,7 +219,7 @@ void BufferTrendyPhraseString(void) ConvertEasyChatWordsToString(gStringVar1, s->words, 2, 1); } -#ifndef NONMATCHING + void TrendyPhraseIsOld(void) { u8 result = 0; @@ -237,19 +237,6 @@ void TrendyPhraseIsOld(void) gSpecialVar_Result = result; } -#else -void TrendyPhraseIsOld(void) -{ - u8 result = 0; - - if (gSaveBlock1Ptr->easyChatPairs[0].unk0_0 - gSaveBlock1Ptr->easyChatPairs[1].unk0_0 < 2) - { - if (!gSaveBlock1Ptr->easyChatPairs[0].unk1_6 && gSaveBlock1Ptr->easyChatPairs[1].unk1_6) - result = 1; - } - gSpecialVar_Result = result; -} -#endif void GetDewfordHallPaintingNameIndex(void) {