Cleanup and documentation
This commit is contained in:
@@ -986,7 +986,7 @@ static void CB2_HandleStartBattle(void)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers != 0)
|
||||
{
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
*(&gBattleStruct->field_180) = 0;
|
||||
*(&gBattleStruct->field_181) = 3;
|
||||
@@ -1035,7 +1035,7 @@ static void CB2_HandleStartBattle(void)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1050,7 +1050,7 @@ static void CB2_HandleStartBattle(void)
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty + 2, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1065,7 +1065,7 @@ static void CB2_HandleStartBattle(void)
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty + 4, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1107,7 +1107,7 @@ static void CB2_HandleStartBattle(void)
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gRecordedBattleRngSeed, sizeof(gRecordedBattleRngSeed));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1194,7 +1194,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
GetBattleTowerTrainerLanguage(&language, gTrainerBattleOpponent_B);
|
||||
gLinkPlayers[3].language = language;
|
||||
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
*(&gBattleStruct->field_180) = 0;
|
||||
*(&gBattleStruct->field_181) = 3;
|
||||
@@ -1234,7 +1234,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1258,7 +1258,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty + 2, sizeof(struct Pokemon));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1282,7 +1282,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gEnemyParty, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1300,7 +1300,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gEnemyParty + 2, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1318,7 +1318,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gEnemyParty + 4, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1360,7 +1360,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gRecordedBattleRngSeed, sizeof(gRecordedBattleRngSeed));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1440,7 +1440,7 @@ static void CB2_PreInitMultiBattle(void)
|
||||
switch (gBattleCommunication[MULTIUSE_STATE])
|
||||
{
|
||||
case 0:
|
||||
if (gReceivedRemoteLinkPlayers != 0 && sub_800A520())
|
||||
if (gReceivedRemoteLinkPlayers != 0 && IsLinkTaskFinished())
|
||||
{
|
||||
gUnknown_02023058 = Alloc(sizeof(struct UnknownPokemonStruct4) * 3);
|
||||
sub_80379F8(0);
|
||||
@@ -1478,7 +1478,7 @@ static void CB2_PreInitMultiBattle(void)
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (sub_800A520() && !gPaletteFade.active)
|
||||
if (IsLinkTaskFinished() && !gPaletteFade.active)
|
||||
{
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
if (gWirelessCommType)
|
||||
@@ -1581,7 +1581,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers != 0)
|
||||
{
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
*(&gBattleStruct->field_180) = 0;
|
||||
*(&gBattleStruct->field_181) = 3;
|
||||
@@ -1643,7 +1643,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
break;
|
||||
// fall through
|
||||
case 3:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1706,7 +1706,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty + 2, sizeof(struct Pokemon));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
@@ -1802,7 +1802,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (sub_800A520())
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
u32* ptr = (u32*)(&gBattleStruct->field_180);
|
||||
ptr[0] = gBattleTypeFlags;
|
||||
@@ -2361,7 +2361,7 @@ static void sub_8038F34(void)
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
break;
|
||||
case 6:
|
||||
if (sub_800A520() == TRUE)
|
||||
if (IsLinkTaskFinished() == TRUE)
|
||||
{
|
||||
sub_800ADF8();
|
||||
BattlePutTextOnWindow(gText_LinkStandby3, 0);
|
||||
@@ -2371,7 +2371,7 @@ static void sub_8038F34(void)
|
||||
case 7:
|
||||
if (!IsTextPrinterActive(0))
|
||||
{
|
||||
if (sub_800A520() == TRUE)
|
||||
if (IsLinkTaskFinished() == TRUE)
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -2546,7 +2546,7 @@ static void sub_803939C(void)
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (sub_800A520() == TRUE)
|
||||
if (IsLinkTaskFinished() == TRUE)
|
||||
{
|
||||
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
|
||||
if (gMain.field_439_x4)
|
||||
@@ -2596,7 +2596,7 @@ static void sub_803939C(void)
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
if (sub_800A520() == TRUE && !IsTextPrinterActive(0) && --gBattleCommunication[1] == 0)
|
||||
if (IsLinkTaskFinished() == TRUE && !IsTextPrinterActive(0) && --gBattleCommunication[1] == 0)
|
||||
{
|
||||
if (gMain.field_439_x4)
|
||||
{
|
||||
@@ -2612,7 +2612,7 @@ static void sub_803939C(void)
|
||||
{
|
||||
if (gMain.field_439_x4)
|
||||
{
|
||||
if (sub_800A520() == TRUE)
|
||||
if (IsLinkTaskFinished() == TRUE)
|
||||
{
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK);
|
||||
gBattleCommunication[1] = 0x20;
|
||||
|
||||
Reference in New Issue
Block a user