More link stuff, stumped on sub_807A728

This commit is contained in:
Diegoisawesome
2018-12-24 14:39:05 -06:00
parent 3f08e0c76c
commit 2bca45bcf5
2 changed files with 47 additions and 75 deletions

View File

@@ -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;
}