Merge branch 'master' into doc-miscbattle
This commit is contained in:
+17
-17
@@ -984,7 +984,7 @@ static void CB2_HandleStartBattle(void)
|
||||
gLinkPlayers[1].id = 1;
|
||||
}
|
||||
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gBattleStruct->multiBuffer.linkBattlerHeader, sizeof(gBattleStruct->multiBuffer.linkBattlerHeader));
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &gBattleStruct->multiBuffer.linkBattlerHeader, sizeof(gBattleStruct->multiBuffer.linkBattlerHeader));
|
||||
gBattleCommunication[MULTIUSE_STATE] = 2;
|
||||
}
|
||||
if (gWirelessCommType)
|
||||
@@ -1024,7 +1024,7 @@ static void CB2_HandleStartBattle(void)
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
// Send Pokémon 1-2
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty, sizeof(struct Pokemon) * 2);
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), gPlayerParty, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1041,7 +1041,7 @@ static void CB2_HandleStartBattle(void)
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
// Send Pokémon 3-4
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gPlayerParty[2], sizeof(struct Pokemon) * 2);
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &gPlayerParty[2], sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1058,7 +1058,7 @@ static void CB2_HandleStartBattle(void)
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
// Send Pokémon 5-6
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gPlayerParty[4], sizeof(struct Pokemon) * 2);
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &gPlayerParty[4], sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1105,7 +1105,7 @@ static void CB2_HandleStartBattle(void)
|
||||
// Both players are using Emerald, send rng seed for recorded battle
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gRecordedBattleRngSeed, sizeof(gRecordedBattleRngSeed));
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &gRecordedBattleRngSeed, sizeof(gRecordedBattleRngSeed));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1198,7 +1198,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
*(&gBattleStruct->multiBuffer.linkBattlerHeader.versionSignatureHi) = 3;
|
||||
BufferPartyVsScreenHealth_AtStart();
|
||||
SetPlayerBerryDataInBattleStruct();
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gBattleStruct->multiBuffer.linkBattlerHeader, sizeof(gBattleStruct->multiBuffer.linkBattlerHeader));
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &gBattleStruct->multiBuffer.linkBattlerHeader, sizeof(gBattleStruct->multiBuffer.linkBattlerHeader));
|
||||
gBattleCommunication[MULTIUSE_STATE] = 2;
|
||||
}
|
||||
|
||||
@@ -1236,7 +1236,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
// Send Pokémon 1-2
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty, sizeof(struct Pokemon) * 2);
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), gPlayerParty, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1262,7 +1262,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
// Send Pokémon 3
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gPlayerParty[2], sizeof(struct Pokemon));
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &gPlayerParty[2], sizeof(struct Pokemon));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1288,7 +1288,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
// Send enemy Pokémon 1-2 to partner
|
||||
SendBlock(bitmask_all_link_players_but_self(), gEnemyParty, sizeof(struct Pokemon) * 2);
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), gEnemyParty, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1306,7 +1306,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
// Send enemy Pokémon 3-4 to partner
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gEnemyParty[2], sizeof(struct Pokemon) * 2);
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &gEnemyParty[2], sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1324,7 +1324,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
// Send enemy Pokémon 5-6 to partner
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gEnemyParty[4], sizeof(struct Pokemon) * 2);
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &gEnemyParty[4], sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1365,7 +1365,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
// Send rng seed for recorded battle
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gRecordedBattleRngSeed, sizeof(gRecordedBattleRngSeed));
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &gRecordedBattleRngSeed, sizeof(gRecordedBattleRngSeed));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1447,7 +1447,7 @@ static void CB2_PreInitMultiBattle(void)
|
||||
{
|
||||
sMultiPartnerPartyBuffer = Alloc(sizeof(gMultiPartnerParty));
|
||||
SetMultiPartnerMenuParty(0);
|
||||
SendBlock(bitmask_all_link_players_but_self(), sMultiPartnerPartyBuffer, sizeof(gMultiPartnerParty));
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), sMultiPartnerPartyBuffer, sizeof(gMultiPartnerParty));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1592,7 +1592,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
BufferPartyVsScreenHealth_AtStart();
|
||||
SetPlayerBerryDataInBattleStruct();
|
||||
|
||||
SendBlock(bitmask_all_link_players_but_self(), &gBattleStruct->multiBuffer.linkBattlerHeader, sizeof(gBattleStruct->multiBuffer.linkBattlerHeader));
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &gBattleStruct->multiBuffer.linkBattlerHeader, sizeof(gBattleStruct->multiBuffer.linkBattlerHeader));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
if (gWirelessCommType)
|
||||
@@ -1649,7 +1649,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
case 3:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty, sizeof(struct Pokemon) * 2);
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), gPlayerParty, sizeof(struct Pokemon) * 2);
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1712,7 +1712,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
case 5:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), gPlayerParty + 2, sizeof(struct Pokemon));
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), gPlayerParty + 2, sizeof(struct Pokemon));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
@@ -1811,7 +1811,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
u32* ptr = gBattleStruct->multiBuffer.battleVideo;
|
||||
ptr[0] = gBattleTypeFlags;
|
||||
ptr[1] = gRecordedBattleRngSeed; // UB: overwrites berry data
|
||||
SendBlock(bitmask_all_link_players_but_self(), ptr, sizeof(gBattleStruct->multiBuffer.battleVideo));
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), ptr, sizeof(gBattleStruct->multiBuffer.battleVideo));
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user