From 072797844a4f028ee5d21de06657a04c4618362d Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Mon, 26 Oct 2020 00:29:55 -0400 Subject: [PATCH] port TrendyPhraseIdOld fakematch fix --- src/dewford_trend.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/dewford_trend.c b/src/dewford_trend.c index e3b98859c..5c7e50f16 100644 --- a/src/dewford_trend.c +++ b/src/dewford_trend.c @@ -222,15 +222,18 @@ void BufferTrendyPhraseString(void) void TrendyPhraseIsOld(void) { u16 result = 0; - - if (gSaveBlock1Ptr->easyChatPairs[0].unk0_0 - gSaveBlock1Ptr->easyChatPairs[1].unk0_0 < 2) + + do { - #ifndef NONMATCHING - asm("":::"r2"); //Force the compiler to store address of gSaveBlock1 in r3 instead of r2 - #endif - if (!gSaveBlock1Ptr->easyChatPairs[0].unk1_6 && gSaveBlock1Ptr->easyChatPairs[1].unk1_6) - result = 1; - } + if (gSaveBlock1Ptr->easyChatPairs[0].unk0_0 - gSaveBlock1Ptr->easyChatPairs[1].unk0_0 > 1) + break; + if (gSaveBlock1Ptr->easyChatPairs[0].unk1_6) + break; + if (!gSaveBlock1Ptr->easyChatPairs[1].unk1_6) + break; + result = 1; + } while (0); + gSpecialVar_Result = result; }