From 8e4320cc211da9d0ccd14a2b9c220cf85c05aeef Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Thu, 3 Jun 2021 12:45:59 -0400 Subject: Sync LinkPlayer Struct with pokeemerald In pokefirered, the `LinkPlayer` struct used an 11-byte name field and puts extra link-related info in the last three bytes. pokeemerald separates these last three bytes into their own fields. This commit replicates how pokeemerald handles those fields. Also renamed `IntlConvertLinkPlayerName` to pokeemerald's `ConvertLinkPlayerName` because I was there and noticed it. --- src/trade.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/trade.c') diff --git a/src/trade.c b/src/trade.c index 656cba37b..4893f5724 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2623,7 +2623,7 @@ static u32 TestWhetherSelectedMonCanBeTraded(struct Pokemon * party, int partyCo if ((player->version & 0xFF) != VERSION_RUBY && (player->version & 0xFF) != VERSION_SAPPHIRE) { - if ((player->name[10] & 0xF) == 0) + if ((player->progressFlagsCopy & 0xF) == 0) { if (species2[cursorPos] == SPECIES_EGG) { @@ -2697,11 +2697,11 @@ s32 Trade_CalcLinkPlayerCompatibilityParam(void) if (val > 0) { - if (gLinkPlayers[GetMultiplayerId()].name[10] & 0xF0) + if (gLinkPlayers[GetMultiplayerId()].progressFlagsCopy & 0xF0) { if (val == 2) { - if (gLinkPlayers[GetMultiplayerId() ^ 1].name[10] & 0xF0) + if (gLinkPlayers[GetMultiplayerId() ^ 1].progressFlagsCopy & 0xF0) { return 0; } -- cgit v1.2.3