diff options
author | PokeCodec <67983839+PokeCodec@users.noreply.github.com> | 2020-09-09 15:23:52 -0400 |
---|---|---|
committer | PokeCodec <67983839+PokeCodec@users.noreply.github.com> | 2020-09-09 15:49:51 -0400 |
commit | 84a92279c9133dfba085af05a0f2b6cce461d765 (patch) | |
tree | 7557609441f26b14d23936ebad5bb8ef280009aa /src | |
parent | dc34cf1711d661d7de6ab23ac91702c16c2c2b57 (diff) |
Record mixing fakematch fixed!
Diffstat (limited to 'src')
-rw-r--r-- | src/dewford_trend.c | 38 | ||||
-rw-r--r-- | src/pokemon.c | 2 | ||||
-rw-r--r-- | src/record_mixing.c | 27 |
3 files changed, 31 insertions, 36 deletions
diff --git a/src/dewford_trend.c b/src/dewford_trend.c index e3b98859c..ff1b09041 100644 --- a/src/dewford_trend.c +++ b/src/dewford_trend.c @@ -245,46 +245,46 @@ static bool8 sub_8122A58(struct EasyChatPair *a, struct EasyChatPair *b, u8 c) { case 0: if (a->unk0_0 > b->unk0_0) - return 1; + return TRUE; if (a->unk0_0 < b->unk0_0) - return 0; + return FALSE; if (a->unk0_7 > b->unk0_7) - return 1; + return TRUE; if (a->unk0_7 < b->unk0_7) - return 0; + return FALSE; break; case 1: if (a->unk0_7 > b->unk0_7) - return 1; + return TRUE; if (a->unk0_7 < b->unk0_7) - return 0; + return FALSE; if (a->unk0_0 > b->unk0_0) - return 1; + return TRUE; if (a->unk0_0 < b->unk0_0) - return 0; + return FALSE; break; case 2: if (a->unk0_0 > b->unk0_0) - return 1; + return TRUE; if (a->unk0_0 < b->unk0_0) - return 0; + return FALSE; if (a->unk0_7 > b->unk0_7) - return 1; + return TRUE; if (a->unk0_7 < b->unk0_7) - return 0; + return FALSE; if (a->unk2 > b->unk2) - return 1; + return TRUE; if (a->unk2 < b->unk2) - return 0; + return FALSE; if (a->words[0] > b->words[0]) - return 1; + return TRUE; if (a->words[0] < b->words[0]) - return 0; + return FALSE; if (a->words[1] > b->words[1]) - return 1; + return TRUE; if (a->words[1] < b->words[1]) - return 0; - return 1; + return FALSE; + return TRUE; } return Random() & 1; } diff --git a/src/pokemon.c b/src/pokemon.c index 2440f183e..29f0f6dfc 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -70,7 +70,7 @@ EWRAM_DATA u8 gEnemyPartyCount = 0; EWRAM_DATA struct Pokemon gPlayerParty[PARTY_SIZE] = {0}; EWRAM_DATA struct Pokemon gEnemyParty[PARTY_SIZE] = {0}; EWRAM_DATA struct SpriteTemplate gMultiuseSpriteTemplate = {0}; -EWRAM_DATA struct Unknown_806F160_Struct *gUnknown_020249B4[2] = {NULL}; +EWRAM_DATA struct Unknown_806F160_Struct *gUnknown_020249B4[2] = {NULL, NULL}; // const rom data #include "data/battle_moves.h" diff --git a/src/record_mixing.c b/src/record_mixing.c index 88c49c016..b12b71697 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -866,27 +866,22 @@ static void ReceiveDaycareMailData(struct RecordMixingDayCareMail *src, size_t r } else if (sp1c[i][0] == TRUE && sp1c[i][1] == TRUE) { - u32 var1, var2; + u8 mail1, mail2; sp24[j][0] = i; - var1 = sub_80E7A9C(&_src->mail[0]); - var2 = sub_80E7A9C(&_src->mail[1]); - if (!var1 && var2) + mail1 = sub_80E7A9C(&_src->mail[0]); + mail2 = sub_80E7A9C(&_src->mail[1]); + if (!(mail1 || mail2) || (mail1 && mail2)) //Logical (not bitwise) XOR. Should be ((mail1 || mail2) && !(mail1 && mail2)), but that doesn't match. { - #ifndef NONMATCHING - register u8 one asm("r0") = 1; // boo, a fakematch - sp24[j][1] = one; - #else - sp24[j][1] = 1; - #endif + sp24[j][1] = Random2() % 2; } - else if ((var1 && var2) || (!var1 && !var2)) + else if (mail1 && !mail2) { - sp24[j][1] = Random2() % 2; + sp24[j][1] = 0; } - else if (var1 && !var2) + else if (!mail1 && mail2) { - sp24[j][1] = 0; + sp24[j][1] = 1; } j++; } @@ -921,8 +916,8 @@ static void ReceiveDaycareMailData(struct RecordMixingDayCareMail *src, size_t r } _src = (void *)src + which * recordSize; - memcpy(&gSaveBlock1Ptr->daycare.mons[0].mail, &_src->mail[0], sizeof(struct DayCareMail)); - memcpy(&gSaveBlock1Ptr->daycare.mons[1].mail, &_src->mail[1], sizeof(struct DayCareMail)); + gSaveBlock1Ptr->daycare.mons[0].mail = _src->mail[0]; + gSaveBlock1Ptr->daycare.mons[1].mail = _src->mail[1]; SeedRng(oldSeed); } |