Update argument names in link headers, link_rfu doc cleanup

This commit is contained in:
GriffinR 2021-10-07 15:32:51 -04:00
parent 846942ce48
commit e86d3410a1
6 changed files with 87 additions and 90 deletions

View File

@ -62,9 +62,9 @@ enum {
// Values for errorState
enum {
RFU_ERROR_STATE_NONE,
RFU_ERROR_STATE_1,
RFU_ERROR_STATE_2,
RFU_ERROR_STATE_3,
RFU_ERROR_STATE_OCCURRED,
RFU_ERROR_STATE_PROCESSED,
RFU_ERROR_STATE_DISCONNECTING,
RFU_ERROR_STATE_IGNORE,
};
@ -247,8 +247,8 @@ extern u8 gWirelessStatusIndicatorSpriteId;
void WipeTrainerNameRecords(void);
void InitRFUAPI(void);
void LinkRfu_Shutdown(void);
void Rfu_SetBlockReceivedFlag(u8 who);
void Rfu_ResetBlockReceivedFlag(u8 who);
void Rfu_SetBlockReceivedFlag(u8 linkPlayerId);
void Rfu_ResetBlockReceivedFlag(u8 linkPlayerId);
bool32 IsSendingKeysToRfu(void);
void StartSendingKeysToRfu(void);
void Rfu_SetBerryBlenderLinkCallback(void);
@ -278,9 +278,9 @@ void UpdateGameData_GroupLockedIn(u8 startedActivity);
void RfuSetErrorParams(u32 errorInfo);
void RfuSetStatus(u8 status, u16 errorInfo);
u8 Rfu_SetLinkRecovery(bool32 enable);
void CopyHostRfuGameDataAndUsername(struct RfuGameData *buff1, u8 *buff2);
void CopyHostRfuGameDataAndUsername(struct RfuGameData *gameData, u8 *username);
void SetHostRfuGameData(u8 activity, u32 partnerInfo, bool32 startedActivity);
void InitializeRfuLinkManager_LinkLeader(u32 a0);
void InitializeRfuLinkManager_LinkLeader(u32 groupMax);
bool32 IsRfuCommunicatingWithAllChildren(void);
void LinkRfu_StopManagerAndFinalizeSlots(void);
bool32 RfuTryDisconnectLeavingChildren(void);
@ -296,21 +296,21 @@ void SendLeaveGroupNotice(void);
void RecordMixTrainerNames(void);
void LinkRfu_CreateConnectionAsParent(void);
void LinkRfu_StopManagerBeforeEnteringChat(void);
void UpdateGameData_SetActivity(u8 activity, u32 flags, bool32 startedActivity);
void CreateTask_RfuReconnectWithParent(const u8 *src, u16 trainerId);
void UpdateGameData_SetActivity(u8 activity, u32 partnerInfo, bool32 startedActivity);
void CreateTask_RfuReconnectWithParent(const u8 *name, u16 trainerId);
void SetHostRfuWonderFlags(bool32 hasNews, bool32 hasCard);
void ResetHostRfuGameData(void);
void SetTradeBoardRegisteredMonInfo(u32 type, u32 species, u32 level);
void InitializeRfuLinkManager_EnterUnionRoom(void);
void TryConnectToUnionRoomParent(const u8 *name, struct RfuGameData *structPtr, u8 a2);
void TryConnectToUnionRoomParent(const u8 *name, struct RfuGameData *parent, u8 activity);
bool32 IsUnionRoomListenTaskActive(void);
void Rfu_SendPacket(void *data);
bool32 PlayerHasMetTrainerBefore(u16 id, u8 *name);
void Rfu_DisconnectPlayerById(u32 playerIdx);
u8 GetLinkPlayerInfoFlags(s32 playerId);
void StopUnionRoomLinkManager(void);
bool8 Rfu_GetCompatiblePlayerData(struct RfuGameData *player, u8 *username, u8 idx);
bool8 Rfu_GetWonderDistributorPlayerData(struct RfuGameData *player, u8 *username, u8 idx);
bool8 Rfu_GetCompatiblePlayerData(struct RfuGameData *gameData, u8 *username, u8 idx);
bool8 Rfu_GetWonderDistributorPlayerData(struct RfuGameData *gameData, u8 *username, u8 idx);
s32 Rfu_GetIndexOfNewestChild(u8 bits);
void CreateTask_RfuIdle(void);
void DestroyTask_RfuIdle(void);
@ -328,8 +328,8 @@ void RfuRecvQueue_Enqueue(struct RfuRecvQueue *queue, u8 *data);
void RfuSendQueue_Enqueue(struct RfuSendQueue *queue, u8 *data);
bool8 RfuRecvQueue_Dequeue(struct RfuRecvQueue *queue, u8 *dest);
bool8 RfuSendQueue_Dequeue(struct RfuSendQueue *queue, u8 *dest);
void RfuBackupQueue_Enqueue(struct RfuBackupQueue *queue, const u8 *q2);
bool8 RfuBackupQueue_Dequeue(struct RfuBackupQueue *queue, u8 *q2);
void RfuBackupQueue_Enqueue(struct RfuBackupQueue *queue, const u8 *data);
bool8 RfuBackupQueue_Dequeue(struct RfuBackupQueue *queue, u8 *src);
void InitHostRfuGameData(struct RfuGameData *data, u8 activity, bool32 startedActivity, s32 partnerInfo);
void CreateWirelessStatusIndicatorSprite(u8 x, u8 y);
void DestroyWirelessStatusIndicatorSprite(void);

View File

@ -32,8 +32,8 @@ struct RfuPlayer
u16 timeoutCounter;
u8 groupScheduledAnim:2;
bool8 useRedText:1; // Never set
u8 field_1B;
u8 filler[3];
u8 newPlayerCountdown;
u8 unused;
};
struct RfuPlayerList
@ -108,7 +108,7 @@ struct WirelessLink_URoom
struct RfuPlayerList *spawnPlayer;
struct RfuIncomingPlayerList *incomingParentList;
u16 unknown; // Never read
u16 field_12;
u16 unreadPlayerId;
u8 state;
u8 stateAfterPrint;
u8 textState;
@ -153,9 +153,9 @@ extern u8 gUnionRoomRequestedMonType;
u8 CreateTask_CreateTradeMenu(void);
void SetUsingUnionRoomStartMenu(void);
void MEvent_CreateTask_CardOrNewsWithFriend(u32 arg0);
void MEvent_CreateTask_CardOrNewsOverWireless(u32 arg0);
void MEvent_CreateTask_Leader(u32 arg0);
void MEvent_CreateTask_CardOrNewsWithFriend(u32 activity);
void MEvent_CreateTask_CardOrNewsOverWireless(u32 activity);
void MEvent_CreateTask_Leader(u32 activity);
u8 CreateTask_ListenToWireless(void);
void StartUnionRoomBattle(u16 battleFlags);

View File

@ -3,12 +3,12 @@
u8 InitUnionRoomPlayerObjects(struct UnionRoomObject *players);
void DestroyUnionRoomPlayerObjects(void);
void CreateUnionRoomPlayerSprites(u8 *spriteIds, s32 playerIdx);
void CreateUnionRoomPlayerSprites(u8 *spriteIds, s32 leaderId);
void DestroyUnionRoomPlayerSprites(u8 *spriteIds);
void SetTilesAroundUnionRoomPlayersPassable(void);
void ScheduleUnionRoomPlayerRefresh(struct WirelessLink_URoom *uroom);
void HandleUnionRoomPlayerRefresh(struct WirelessLink_URoom *uroom);
bool32 TryInteractWithUnionRoomMember(struct RfuPlayerList *main0, s16 *directionPtr, s16 *playerIdxPtr, u8 *spriteIds);
void UpdateUnionRoomMemberFacing(u32 currDirection, u32 playerIdx, struct RfuPlayerList *main0);
bool32 TryInteractWithUnionRoomMember(struct RfuPlayerList *list, s16 *memberIdPtr, s16 *leaderIdPtr, u8 *spriteIds);
void UpdateUnionRoomMemberFacing(u32 memberId, u32 leaderId, struct RfuPlayerList *list);
#endif //GUARD_UNION_ROOM_PLAYER_AVATAR_H

View File

@ -984,12 +984,12 @@ static u32 QuitBerryCrush(MainCallback exitCallback)
return 0;
}
#define ERROR_EXIT(exitCallback) \
{ \
SetMainCallback2(exitCallback); \
gRfu.errorParam0 = 0; \
gRfu.errorParam1 = 0; \
gRfu.errorState = RFU_ERROR_STATE_1; \
#define ERROR_EXIT(exitCallback) \
{ \
SetMainCallback2(exitCallback); \
gRfu.errorParam0 = 0; \
gRfu.errorParam1 = 0; \
gRfu.errorState = RFU_ERROR_STATE_OCCURRED; \
}
void StartBerryCrush(MainCallback exitCallback)

View File

@ -27,7 +27,7 @@ enum {
RFUSTATE_STOP_MANAGER_END,
RFUSTATE_CHILD_CONNECT,
RFUSTATE_CHILD_CONNECT_END,
RFUSTATE_8, // Unused
RFUSTATE_UNUSED,
RFUSTATE_RECONNECTED,
RFUSTATE_CONNECTED,
RFUSTATE_CHILD_TRY_JOIN,
@ -39,9 +39,6 @@ enum {
};
// These states are used for different purposes
// depending on the link mode (parent, child, union room)
#define RFUSTATE_17 17
#define RFUSTATE_PARENT_RECONNECT 18
#define RFUSTATE_PARENT_FINALIZE_START 17
#define RFUSTATE_PARENT_FINALIZE 18
#define RFUSTATE_UR_CONNECT 17
@ -1443,7 +1440,7 @@ static void WaitAllReadyToCloseLink(void)
gBattleTypeFlags &= ~BATTLE_TYPE_LINK_IN_BATTLE;
if (gRfu.parentChild == MODE_CHILD)
{
gRfu.errorState = RFU_ERROR_STATE_3;
gRfu.errorState = RFU_ERROR_STATE_DISCONNECTING;
TryDisconnectRfu();
}
else
@ -1982,14 +1979,14 @@ static void Task_PlayerExchangeChat(u8 taskId)
static void RfuCheckErrorStatus(void)
{
if (gRfu.errorState == RFU_ERROR_STATE_1 && lman.childClockSlave_flag == 0)
if (gRfu.errorState == RFU_ERROR_STATE_OCCURRED && lman.childClockSlave_flag == 0)
{
if (gMain.callback2 == c2_mystery_gift_e_reader_run || lman.init_param->mboot_flag)
gWirelessCommType = 2;
SetMainCallback2(CB2_LinkError);
gMain.savedCallback = CB2_LinkError;
SetLinkErrorBuffer((gRfu.errorInfo << 16) | (gRfu.errorParam0 << 8) | gRfu.errorParam1, gRfu.recvQueue.count, gRfu.sendQueue.count, RfuGetStatus() == RFU_STATUS_CONNECTION_ERROR);
gRfu.errorState = RFU_ERROR_STATE_2;
gRfu.errorState = RFU_ERROR_STATE_PROCESSED;
CloseLink();
}
else if (gRfu.sendQueue.full == TRUE || gRfu.recvQueue.full == TRUE)
@ -2100,10 +2097,10 @@ void UpdateGameData_GroupLockedIn(bool8 startedActivity)
rfu_REQ_configGameData(0, RFU_SERIAL_GAME, (void *)&gHostRfuGameData, gHostRfuUsername);
}
void UpdateGameData_SetActivity(u8 activity, u32 flags, bool32 startedActivity)
void UpdateGameData_SetActivity(u8 activity, u32 partnerInfo, bool32 startedActivity)
{
if (activity != ACTIVITY_NONE)
SetHostRfuGameData(activity, flags, startedActivity);
SetHostRfuGameData(activity, partnerInfo, startedActivity);
rfu_REQ_configGameData(0, RFU_SERIAL_GAME, (void *)&gHostRfuGameData, gHostRfuUsername);
}
@ -2144,7 +2141,7 @@ void RfuSetErrorParams(u32 errorInfo)
gRfu.errorParam0 = lman.param[0];
gRfu.errorParam1 = lman.param[1];
gRfu.errorInfo = errorInfo;
gRfu.errorState = RFU_ERROR_STATE_1;
gRfu.errorState = RFU_ERROR_STATE_OCCURRED;
}
}
@ -2370,7 +2367,7 @@ static void LinkManagerCB_UnionRoom(u8 msg, u8 paramCount)
switch (msg)
{
case LMAN_MSG_INITIALIZE_COMPLETED:
gRfu.state = RFUSTATE_17;
gRfu.state = RFUSTATE_UR_CONNECT;
break;
case LMAN_MSG_NEW_CHILD_CONNECT_DETECTED:
RfuSetStatus(RFU_STATUS_NEW_CHILD_DETECTED, 0);
@ -2430,7 +2427,7 @@ static void LinkManagerCB_UnionRoom(u8 msg, u8 paramCount)
gRfu.childSlot = lman.param[0];
break;
case LMAN_MSG_CONNECT_PARENT_FAILED:
gRfu.state = RFUSTATE_PARENT_RECONNECT;
gRfu.state = RFUSTATE_UR_CONNECT_END;
if (gRfu.connectParentFailures < 2)
{
gRfu.connectParentFailures++;
@ -2483,7 +2480,7 @@ static void LinkManagerCB_UnionRoom(u8 msg, u8 paramCount)
if (gRfuLinkStatus->parentChild == MODE_NEUTRAL
&& !lman.pcswitch_flag
&& FuncIsActiveTask(Task_UnionRoomListen) == TRUE)
gRfu.state = RFUSTATE_17;
gRfu.state = RFUSTATE_UR_CONNECT;
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, msg);
break;
@ -2617,13 +2614,13 @@ static void CB2_RfuIdle(void)
UpdatePaletteFade();
}
void InitializeRfuLinkManager_LinkLeader(u32 a0)
void InitializeRfuLinkManager_LinkLeader(u32 groupMax)
{
gRfu.parentChild = MODE_PARENT;
SetHostRfuUsername();
rfu_LMAN_initializeManager(LinkManagerCB_Parent, NULL);
sRfuReqConfig = sRfuReqConfigTemplate;
sRfuReqConfig.availSlot_flag = sAvailSlots[a0 - 1];
sRfuReqConfig.availSlot_flag = sAvailSlots[groupMax - 1];
CreateTask_ParentSearchForChildren();
}

View File

@ -187,11 +187,11 @@ enum {
// Return values for HandlePlayerListUpdate
enum {
PLIST_0,
PLIST_1,
PLIST_2,
PLIST_3,
PLIST_4,
PLIST_NONE,
PLIST_NEW_PLAYER,
PLIST_RECENT_UPDATE,
PLIST_UNUSED,
PLIST_CONTACTED,
};
static EWRAM_DATA u8 sUnionRoomPlayerName[12] = {};
@ -414,7 +414,7 @@ static void Task_TryBecomeLinkLeader(u8 taskId)
data->playerList->players[0].timeoutCounter = 0;
data->playerList->players[0].groupScheduledAnim = UNION_ROOM_SPAWN_IN;
data->playerList->players[0].useRedText = FALSE;
data->playerList->players[0].field_1B = 0;
data->playerList->players[0].newPlayerCountdown = 0;
data->listenTaskId = CreateTask_ListenForCompatiblePartners(data->incomingPlayerList, 0xFF);
data->bButtonCancelWindowId = AddWindow(&sWindowTemplate_BButtonCancel);
switch (GROUP_MAX(sPlayerActivityGroupSize))
@ -559,7 +559,7 @@ static void Task_TryBecomeLinkLeader(u8 taskId)
{
if (data->joinRequestAnswer == RFU_STATUS_JOIN_GROUP_OK)
{
data->playerList->players[data->playerCount].field_1B = 0;
data->playerList->players[data->playerCount].newPlayerCountdown = 0;
RedrawListMenu(data->listTaskId);
data->playerCount++;
if (data->playerCount == GROUP_MAX(sPlayerActivityGroupSize))
@ -867,7 +867,7 @@ static void ItemPrintFunc_PossibleGroupMembers(u8 windowId, u32 id, u8 y)
switch (data->playerList->players[id].groupScheduledAnim)
{
case UNION_ROOM_SPAWN_IN:
if (data->playerList->players[id].field_1B != 0)
if (data->playerList->players[id].newPlayerCountdown != 0)
colorIdx = UR_COLOR_GREEN;
break;
case UNION_ROOM_SPAWN_OUT:
@ -913,7 +913,7 @@ static u8 LeaderUpdateGroupMembership(struct RfuPlayerList *list)
{
for (id = 0; id < MAX_RFU_PLAYERS; id++)
{
if (data->playerList->players[id].field_1B != 0)
if (data->playerList->players[id].newPlayerCountdown != 0)
ret = UNION_ROOM_SPAWN_IN;
}
}
@ -948,14 +948,14 @@ static u8 LeaderPrunePlayerList(struct RfuPlayerList *list)
data->playerList->players[copiedCount].timeoutCounter = 0;
data->playerList->players[copiedCount].groupScheduledAnim = UNION_ROOM_SPAWN_NONE;
data->playerList->players[copiedCount].useRedText = FALSE;
data->playerList->players[copiedCount].field_1B = 0;
data->playerList->players[copiedCount].newPlayerCountdown = 0;
}
for (i = 0; i < MAX_RFU_PLAYERS; i++)
{
if (data->playerList->players[i].groupScheduledAnim != UNION_ROOM_SPAWN_IN)
continue;
if (data->playerList->players[i].field_1B != 64)
if (data->playerList->players[i].newPlayerCountdown != 64)
continue;
playerCount = i;
@ -1382,7 +1382,7 @@ static u8 GetGroupListTextColor(struct WirelessLink_Group *data, u32 id)
return UR_COLOR_WHITE;
else if (data->playerList->players[id].useRedText)
return UR_COLOR_RED;
else if (data->playerList->players[id].field_1B != 0)
else if (data->playerList->players[id].newPlayerCountdown != 0)
return UR_COLOR_GREEN;
}
return UR_COLOR_DEFAULT;
@ -1415,15 +1415,15 @@ static u8 GetNewLeaderCandidate(void)
if (ArePlayerDataDifferent(&data->playerList->players[i].rfu, &data->incomingPlayerList->players[id].rfu))
{
data->playerList->players[i].rfu = data->incomingPlayerList->players[id].rfu;
data->playerList->players[i].field_1B = 64;
data->playerList->players[i].newPlayerCountdown = 64;
ret = 1;
}
else
{
if (data->playerList->players[i].field_1B != 0)
if (data->playerList->players[i].newPlayerCountdown != 0)
{
data->playerList->players[i].field_1B--;
if (data->playerList->players[i].field_1B == 0)
data->playerList->players[i].newPlayerCountdown--;
if (data->playerList->players[i].newPlayerCountdown == 0)
ret = 2;
}
}
@ -1431,7 +1431,7 @@ static u8 GetNewLeaderCandidate(void)
else
{
data->playerList->players[i].groupScheduledAnim = UNION_ROOM_SPAWN_IN;
data->playerList->players[i].field_1B = 64;
data->playerList->players[i].newPlayerCountdown = 64;
ret = 1;
}
@ -1899,7 +1899,7 @@ static void Task_MEvent_Leader(u8 taskId)
data->playerList->players[0].timeoutCounter = 0;
data->playerList->players[0].groupScheduledAnim = UNION_ROOM_SPAWN_IN;
data->playerList->players[0].useRedText = FALSE;
data->playerList->players[0].field_1B = 0;
data->playerList->players[0].newPlayerCountdown = 0;
data->listenTaskId = CreateTask_ListenForCompatiblePartners(data->incomingPlayerList, 0xFF);
winTemplate = sWindowTemplate_PlayerList;
@ -1949,7 +1949,7 @@ static void Task_MEvent_Leader(u8 taskId)
case 0:
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
data->playerList->players[data->playerCount].field_1B = 0;
data->playerList->players[data->playerCount].newPlayerCountdown = 0;
RedrawListMenu(data->listTaskId);
data->joinRequestAnswer = RFU_STATUS_JOIN_GROUP_OK;
SendRfuStatusToPartner(data->joinRequestAnswer, ReadAsU16(data->playerList->players[data->playerCount].rfu.data.compatibility.playerTrainerId), data->playerList->players[data->playerCount].rfu.name);
@ -1969,7 +1969,7 @@ static void Task_MEvent_Leader(u8 taskId)
{
if (data->joinRequestAnswer == RFU_STATUS_JOIN_GROUP_OK)
{
data->playerList->players[data->playerCount].field_1B = 0;
data->playerList->players[data->playerCount].newPlayerCountdown = 0;
RedrawListMenu(data->listTaskId);
data->playerCount++;
CopyAndTranslatePlayerName(gStringVar1, &data->playerList->players[data->playerCount - 1]);
@ -2430,7 +2430,7 @@ void RunUnionRoom(void)
uroom->state = UR_STATE_INIT;
uroom->textState = 0;
uroom->unknown = 0;
uroom->field_12 = 0;
uroom->unreadPlayerId = 0;
gSpecialVar_Result = 0;
ListMenuLoadStdPalAt(0xD0, 1);
@ -2610,12 +2610,12 @@ static void Task_RunUnionRoom(u8 taskId)
switch (HandlePlayerListUpdate())
{
case PLIST_1:
case PLIST_NEW_PLAYER:
PlaySE(SE_PC_LOGIN);
case PLIST_2:
case PLIST_RECENT_UPDATE:
ScheduleUnionRoomPlayerRefresh(uroom);
break;
case PLIST_4:
case PLIST_CONTACTED:
uroom->state = UR_STATE_PLAYER_CONTACTED_YOU;
StartScriptInteraction();
SetTradeBoardRegisteredMonInfo(TYPE_NORMAL, SPECIES_NONE, 0);
@ -2643,7 +2643,7 @@ static void Task_RunUnionRoom(u8 taskId)
break;
case 1: // Link communicating
TryConnectToUnionRoomParent(uroom->playerList->players[taskData[1]].rfu.name, &uroom->playerList->players[taskData[1]].rfu.data, gPlayerCurrActivity);
uroom->field_12 = id; // Should be just 0, but won't match any other way.
uroom->unreadPlayerId = id; // Should be just 0, but won't match any other way.
uroom->state = UR_STATE_TRY_COMMUNICATING;
break;
case 2: // Ask to join chat
@ -2833,7 +2833,7 @@ static void Task_RunUnionRoom(u8 taskId)
gPlayerCurrActivity = ACTIVITY_CHAT | IN_UNION_ROOM;
UpdateGameData_SetActivity(ACTIVITY_CHAT | IN_UNION_ROOM, 0, TRUE);
TryConnectToUnionRoomParent(uroom->playerList->players[taskData[1]].rfu.name, &uroom->playerList->players[taskData[1]].rfu.data, gPlayerCurrActivity);
uroom->field_12 = taskData[1];
uroom->unreadPlayerId = taskData[1];
uroom->state = UR_STATE_TRY_ACCEPT_CHAT_REQUEST_DELAY;
taskData[3] = 0;
break;
@ -2942,7 +2942,7 @@ static void Task_RunUnionRoom(u8 taskId)
else
UpdateGameData_SetActivity(gPlayerCurrActivity | IN_UNION_ROOM, GetLinkPlayerInfoFlags(1), TRUE);
uroom->spawnPlayer->players[0].field_1B = 0;
uroom->spawnPlayer->players[0].newPlayerCountdown = 0;
taskData[3] = 0;
if (gPlayerCurrActivity == (ACTIVITY_BATTLE_SINGLE | IN_UNION_ROOM))
{
@ -3298,7 +3298,7 @@ void InitUnionRoom(void)
data->state = 0;
data->textState = 0;
data->unknown = 0;
data->field_12 = 0;
data->unreadPlayerId = 0;
sUnionRoomPlayerName[0] = EOS;
}
@ -3336,8 +3336,8 @@ static void Task_InitUnionRoom(u8 taskId)
case 3:
switch (HandlePlayerListUpdate())
{
case PLIST_1:
case PLIST_2:
case PLIST_NEW_PLAYER:
case PLIST_RECENT_UPDATE:
if (sUnionRoomPlayerName[0] == EOS)
{
for (i = 0; i < MAX_UNION_ROOM_LEADERS; i++)
@ -3354,7 +3354,7 @@ static void Task_InitUnionRoom(u8 taskId)
}
}
break;
case PLIST_3:
case PLIST_UNUSED:
break;
}
break;
@ -3390,7 +3390,7 @@ static u8 HandlePlayerListUpdate(void)
s32 i;
u8 j;
struct WirelessLink_URoom *data = sWirelessLinkMain.uRoom;
s32 retVal = PLIST_0;
s32 retVal = PLIST_NONE;
for (i = 0; i < RFU_CHILD_MAX; i++)
{
@ -3399,8 +3399,8 @@ static u8 HandlePlayerListUpdate(void)
data->spawnPlayer->players[0].rfu = data->incomingParentList->players[i].rfu;
data->spawnPlayer->players[0].timeoutCounter = 0;
data->spawnPlayer->players[0].groupScheduledAnim = UNION_ROOM_SPAWN_IN;
data->spawnPlayer->players[0].field_1B = 1;
return PLIST_4;
data->spawnPlayer->players[0].newPlayerCountdown = 1;
return PLIST_CONTACTED;
}
}
for (j = 0; j < MAX_UNION_ROOM_LEADERS; j++)
@ -3415,21 +3415,21 @@ static u8 HandlePlayerListUpdate(void)
if (ArePlayerDataDifferent(&data->playerList->players[j].rfu, &data->incomingChildList->players[i].rfu))
{
data->playerList->players[j].rfu = data->incomingChildList->players[i].rfu;
data->playerList->players[j].field_1B = 64;
retVal = PLIST_1;
data->playerList->players[j].newPlayerCountdown = 64;
retVal = PLIST_NEW_PLAYER;
}
else if (data->playerList->players[j].field_1B != 0)
else if (data->playerList->players[j].newPlayerCountdown != 0)
{
data->playerList->players[j].field_1B--;
if (data->playerList->players[j].field_1B == 0)
retVal = PLIST_2;
data->playerList->players[j].newPlayerCountdown--;
if (data->playerList->players[j].newPlayerCountdown == 0)
retVal = PLIST_RECENT_UPDATE;
}
}
else
{
data->playerList->players[j].groupScheduledAnim = UNION_ROOM_SPAWN_IN;
data->playerList->players[j].field_1B = 0;
retVal = PLIST_2;
data->playerList->players[j].newPlayerCountdown = 0;
retVal = PLIST_RECENT_UPDATE;
}
data->playerList->players[j].timeoutCounter = 0;
}
@ -3439,7 +3439,7 @@ static u8 HandlePlayerListUpdate(void)
if (data->playerList->players[j].timeoutCounter >= 600)
{
data->playerList->players[j].groupScheduledAnim = UNION_ROOM_SPAWN_OUT;
retVal = PLIST_2;
retVal = PLIST_RECENT_UPDATE;
}
}
else if (data->playerList->players[j].groupScheduledAnim == UNION_ROOM_SPAWN_OUT)
@ -3452,7 +3452,7 @@ static u8 HandlePlayerListUpdate(void)
}
for (i = 0; i < RFU_CHILD_MAX; i++)
if (TryAddIncomingPlayerToList(&data->playerList->players[0], &data->incomingChildList->players[i], MAX_UNION_ROOM_LEADERS) != 0xFF)
retVal = PLIST_1;
retVal = PLIST_NEW_PLAYER;
return retVal;
}
@ -3858,7 +3858,7 @@ static void ClearRfuPlayerList(struct RfuPlayer *players, u8 count)
players[i].timeoutCounter = 255;
players[i].groupScheduledAnim = UNION_ROOM_SPAWN_NONE;
players[i].useRedText = FALSE;
players[i].field_1B = 0;
players[i].newPlayerCountdown = 0;
}
}
@ -3948,7 +3948,7 @@ static u8 TryAddIncomingPlayerToList(struct RfuPlayer *players, struct RfuIncomi
players[i].rfu = incomingPlayer->rfu;
players[i].timeoutCounter = 0;
players[i].groupScheduledAnim = UNION_ROOM_SPAWN_IN;
players[i].field_1B = 64;
players[i].newPlayerCountdown = 64;
incomingPlayer->active = FALSE;
return i;
}