From 2bca45bcf5460724770e8f0ef42200dba88299ae Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Mon, 24 Dec 2018 14:39:05 -0600 Subject: More link stuff, stumped on sub_807A728 --- src/trade.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'src') diff --git a/src/trade.c b/src/trade.c index 4327c9793..c0a3bda89 100644 --- a/src/trade.c +++ b/src/trade.c @@ -3195,3 +3195,50 @@ u32 sub_807A5F4(struct Pokemon *a0, int a1, int a2) return 1; } } + +s32 sub_807A728(void) +{ + int val; + u8 version; + + if (gReceivedRemoteLinkPlayers != 0) + { + val = 0; + version = (gLinkPlayers[GetMultiplayerId() ^ 1].version & 0xFF); + if (version == VERSION_RUBY || + version == VERSION_SAPPHIRE || + version == VERSION_EMERALD) + { + // this value could actually be anything 0 or less + val = 0; + } + else if (version == VERSION_FIRE_RED || + version == VERSION_LEAF_GREEN) + { + val = 2; + } + + if (val > 0) + { + if (gLinkPlayers[GetMultiplayerId()].name[10] & 0xF0) + { + if (val == 2) + { + if (gLinkPlayers[GetMultiplayerId() ^ 1].name[10] & 0xF0) + { + return 0; + } + else + { + return 2; + } + } + } + else + { + return 1; + } + } + } + return 0; +} -- cgit v1.2.3