Second pass on documenting union room

This commit is contained in:
GriffinR
2020-06-08 18:16:57 -04:00
parent 35867f531b
commit 2859900ea9
18 changed files with 1227 additions and 1053 deletions

View File

@@ -99,15 +99,15 @@ ALIGNED(4) const u8 sText_OtherTrainerUnavailableNow[] = _("The other TRAINER do
ALIGNED(4) const u8 sText_CantTransmitTrainerTooFar[] = _("You can't transmit with a TRAINER\nwho is too far away.\p");
ALIGNED(4) const u8 sText_TrainersNotReadyYet[] = _("The other TRAINER(S) is/are not\nready yet.\p");
const u8 *const sCantTransmitToTrainerTexts[] = {
sText_CantTransmitTrainerTooFar,
sText_TrainersNotReadyYet
static const u8 *const sCantTransmitToTrainerTexts[] = {
[UR_TRADE_PLAYER_NOT_READY - 1] = sText_CantTransmitTrainerTooFar,
[UR_TRADE_PARTNER_NOT_READY - 1] = sText_TrainersNotReadyYet
};
ALIGNED(4) const u8 sText_ModeWithTheseMembersWillBeCanceled[] = _("The {STR_VAR_1} MODE with\nthese members will be canceled.{PAUSE 60}");
ALIGNED(4) const u8 sText_MemberNoLongerAvailable[] = _("There is a member who can no\nlonger remain available.\p");
const u8 *const sPlayerUnavailableTexts[] = {
static const u8 *const sPlayerUnavailableTexts[] = {
sText_OtherTrainerUnavailableNow,
sText_MemberNoLongerAvailable
};
@@ -120,17 +120,17 @@ ALIGNED(4) const u8 sText_AwaitingOtherMembers[] = _("{STR_VAR_1}!\nAwaiting oth
ALIGNED(4) const u8 sText_QuitBeingMember[] = _("Quit being a member?");
ALIGNED(4) const u8 sText_StoppedBeingMember[] = _("You stopped being a member.\p");
const u8 *const sPlayerDisconnectedTexts[] = {
NULL,
sText_MemberNoLongerAvailable,
sText_TrainerAppearsUnavailable,
NULL,
NULL,
NULL,
sText_PlayerRepliedNo,
NULL,
NULL,
sText_StoppedBeingMember
static const u8 *const sPlayerDisconnectedTexts[] = {
[RFU_STATUS_OK] = NULL,
[RFU_STATUS_FATAL_ERROR] = sText_MemberNoLongerAvailable,
[RFU_STATUS_CONNECTION_ERROR] = sText_TrainerAppearsUnavailable,
[RFU_STATUS_CHILD_SEND_COMPLETE] = NULL,
[RFU_STATUS_NEW_CHILD_DETECTED] = NULL,
[RFU_STATUS_JOIN_GROUP_OK] = NULL,
[RFU_STATUS_JOIN_GROUP_NO] = sText_PlayerRepliedNo,
[RFU_STATUS_WAIT_ACK_JOIN_GROUP] = NULL,
[RFU_STATUS_LEAVE_GROUP_NOTICE] = NULL,
[RFU_STATUS_LEAVE_GROUP] = sText_StoppedBeingMember
};
ALIGNED(4) const u8 sText_WirelessLinkEstablished[] = _("The WIRELESS COMMUNICATION\nSYSTEM link has been established.");
@@ -139,16 +139,16 @@ ALIGNED(4) const u8 sText_LinkWithFriendDropped[] = _("The link with your friend
ALIGNED(4) const u8 sText_PlayerRepliedNo2[] = _("{STR_VAR_1} replied, “No…”");
const u8 *const sLinkDroppedTexts[] = {
NULL,
sText_LinkWithFriendDropped,
sText_LinkWithFriendDropped,
NULL,
NULL,
NULL,
sText_PlayerRepliedNo2,
NULL,
NULL,
NULL
[RFU_STATUS_OK] = NULL,
[RFU_STATUS_FATAL_ERROR] = sText_LinkWithFriendDropped,
[RFU_STATUS_CONNECTION_ERROR] = sText_LinkWithFriendDropped,
[RFU_STATUS_CHILD_SEND_COMPLETE] = NULL,
[RFU_STATUS_NEW_CHILD_DETECTED] = NULL,
[RFU_STATUS_JOIN_GROUP_OK] = NULL,
[RFU_STATUS_JOIN_GROUP_NO] = sText_PlayerRepliedNo2,
[RFU_STATUS_WAIT_ACK_JOIN_GROUP] = NULL,
[RFU_STATUS_LEAVE_GROUP_NOTICE] = NULL,
[RFU_STATUS_LEAVE_GROUP] = NULL
};
ALIGNED(4) const u8 sText_DoYouWantXMode[] = _("Do you want the {STR_VAR_2}\nMODE?");
@@ -260,7 +260,7 @@ ALIGNED(4) const u8 sText_WaitForBattleFemale[] = _("A battle? Of course, but I
ALIGNED(4) const u8 sText_WaitForChatFemale[] = _("Did you want to chat?\nOkay, but please wait a moment.");
ALIGNED(4) const u8 sText_ShowTrainerCardFemale[] = _("As my introduction, I'll show you\nmy TRAINER CARD.");
const u8 *const sText_WaitOrShowCardTexts[GENDER_COUNT][4] = {
static const u8 *const sText_WaitOrShowCardTexts[GENDER_COUNT][4] = {
{
sText_WaitForBattleMale,
sText_WaitForChatMale,
@@ -283,7 +283,7 @@ ALIGNED(4) const u8 sText_TradeWillBeStarted[] = _("The trade will be started.{P
ALIGNED(4) const u8 sText_BattleWillBeStarted[] = _("The battle will be started.{PAUSE 60}");
ALIGNED(4) const u8 sText_EnteringChat[] = _("Entering the chat…{PAUSE 60}");
const u8 *const sStartActivityTexts[][GENDER_COUNT][3] = {
static const u8 *const sStartActivityTexts[][GENDER_COUNT][3] = {
{
{
sText_BattleWillBeStarted,
@@ -334,18 +334,21 @@ const u8 *const sIfYouWantToDoSomethingTexts[GENDER_COUNT] = {
ALIGNED(4) const u8 sText_TrainerBattleBusy[] = _("Whoops! Sorry, but I have to do\nsomething else.\lAnother time, okay?\p");
ALIGNED(4) const u8 sText_NeedTwoMonsOfLevel30OrLower1[] = _("If you want to battle, you need\ntwo POKéMON that are below\lLv. 30.\p");
ALIGNED(4) const u8 sText_NeedTwoMonsOfLevel30OrLower2[] = _("For a battle, you need two\nPOKéMON that are below Lv. 30.\p");
ALIGNED(4) const u8 sText_DeclineBattleMale[] = _("Oh, all right.\nCome see me anytime, okay?\p");
ALIGNED(4) const u8 stext_DeclineBattleFemale[] = _("Oh…\nPlease come by anytime.\p");
static const u8 *const sDeclineBattleTexts[GENDER_COUNT] = {
sText_DeclineBattleMale,
stext_DeclineBattleFemale
ALIGNED(4) const u8 sText_DeclineChatMale[] = _("Oh, all right.\nCome see me anytime, okay?\p");
ALIGNED(4) const u8 stext_DeclineChatFemale[] = _("Oh…\nPlease come by anytime.\p");
// Response from partner when player declines chat
static const u8 *const sDeclineChatTexts[GENDER_COUNT] = {
sText_DeclineChatMale,
stext_DeclineChatFemale
};
ALIGNED(4) const u8 sText_ChatDeclinedMale[] = _("Oh, sorry!\nI just can't right this instant.\lLet's chat another time.\p");
ALIGNED(4) const u8 sText_ChatDeclinedFemale[] = _("Oh, I'm sorry.\nI have too much to do right now.\lLet's chat some other time.\p");
const u8 *const sChatDeclinedTexts[GENDER_COUNT] = {
// Response from partner when they decline chat
static const u8 *const sChatDeclinedTexts[GENDER_COUNT] = {
sText_ChatDeclinedMale,
sText_ChatDeclinedFemale
};
@@ -576,36 +579,36 @@ const u8 *const sGladToMeetYouTexts[GENDER_COUNT] = {
ALIGNED(4) const u8 sText_FinishedCheckingPlayersTrainerCard[] = _("Finished checking {SPECIAL_F7 0x01}'s\nTRAINER CARD.{PAUSE 60}");
const u8 *const sLinkGroupActivityTexts[] = {
sText_EmptyString,
sText_SingleBattle,
sText_DoubleBattle,
sText_MultiBattle,
sText_PokemonTrades,
sText_Chat,
sText_WonderCards,
sText_WonderNews,
sText_Cards,
sText_PokemonJump,
sText_BerryCrush,
sText_BerryPicking,
sText_Search,
sText_EmptyString,
sText_BattleTowerOpenLv,
sText_RecordCorner,
sText_BerryBlender,
sText_EmptyString,
sText_EmptyString,
sText_EmptyString,
sText_EmptyString,
sText_WonderCards,
sText_WonderNews,
sText_CoolContest,
sText_BeautyContest,
sText_CuteContest,
sText_SmartContest,
sText_ToughContest,
sText_BattleTowerLv50
static const u8 *const sLinkGroupActivityNameTexts[] = {
[ACTIVITY_NONE] = sText_EmptyString,
[ACTIVITY_BATTLE_SINGLE] = sText_SingleBattle,
[ACTIVITY_BATTLE_DOUBLE] = sText_DoubleBattle,
[ACTIVITY_BATTLE_MULTI] = sText_MultiBattle,
[ACTIVITY_TRADE] = sText_PokemonTrades,
[ACTIVITY_CHAT] = sText_Chat,
[ACTIVITY_WONDER_CARD] = sText_WonderCards,
[ACTIVITY_WONDER_NEWS] = sText_WonderNews,
[ACTIVITY_CARD] = sText_Cards,
[ACTIVITY_POKEMON_JUMP] = sText_PokemonJump,
[ACTIVITY_BERRY_CRUSH] = sText_BerryCrush,
[ACTIVITY_BERRY_PICK] = sText_BerryPicking,
[ACTIVITY_SEARCH] = sText_Search,
[ACTIVITY_SPIN_TRADE] = sText_EmptyString,
[ACTIVITY_BATTLE_TOWER_OPEN] = sText_BattleTowerOpenLv,
[ACTIVITY_RECORD_CORNER] = sText_RecordCorner,
[ACTIVITY_BERRY_BLENDER] = sText_BerryBlender,
[ACTIVITY_ACCEPT] = sText_EmptyString,
[ACTIVITY_DECLINE] = sText_EmptyString,
[ACTIVITY_NPCTALK] = sText_EmptyString,
[ACTIVITY_PLYRTALK] = sText_EmptyString,
[ACTIVITY_WONDER_CARD2] = sText_WonderCards,
[ACTIVITY_WONDER_NEWS2] = sText_WonderNews,
[ACTIVITY_CONTEST_COOL] = sText_CoolContest,
[ACTIVITY_CONTEST_BEAUTY] = sText_BeautyContest,
[ACTIVITY_CONTEST_CUTE] = sText_CuteContest,
[ACTIVITY_CONTEST_SMART] = sText_SmartContest,
[ACTIVITY_CONTEST_TOUGH] = sText_ToughContest,
[ACTIVITY_BATTLE_TOWER] = sText_BattleTowerLv50
};
static const struct WindowTemplate sWindowTemplate_BButtonCancel = {
@@ -621,6 +624,9 @@ static const struct WindowTemplate sWindowTemplate_BButtonCancel = {
// Minimum and maximum number of players for a link group
// A minimum of 0 means the min and max are equal
#define LINK_GROUP_CAPACITY(min, max)(((min) << 12) | ((max) << 8))
#define GROUP_MAX(capacity)(capacity & 0x0F)
#define GROUP_MIN(capacity)(capacity >> 4)
#define GROUP_MIN2(capacity)(capacity & 0xF0) // Unnecessary to have both, but needed to match
static const u32 sLinkGroupToActivityAndCapacity[NUM_LINK_GROUP_TYPES] = {
[LINK_GROUP_SINGLE_BATTLE] = ACTIVITY_BATTLE_SINGLE | LINK_GROUP_CAPACITY(0, 2),
@@ -647,37 +653,37 @@ static const u32 sLinkGroupToActivityAndCapacity[NUM_LINK_GROUP_TYPES] = {
[LINK_GROUP_BATTLE_TOWER_OPEN] = ACTIVITY_BATTLE_TOWER_OPEN | LINK_GROUP_CAPACITY(0, 2)
};
const struct WindowTemplate gUnknown_082F011C = {
.bg = 0x00,
.tilemapLeft = 0x01,
.tilemapTop = 0x03,
.width = 0x0d,
.height = 0x08,
.paletteNum = 0x0f,
static const struct WindowTemplate sWindowTemplate_PlayerList = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 3,
.width = 13,
.height = 8,
.paletteNum = 15,
.baseBlock = 0x0044
};
const struct WindowTemplate gUnknown_082F0124 = {
.bg = 0x00,
.tilemapLeft = 0x01,
.tilemapTop = 0x03,
.width = 0x0d,
.height = 0x0a,
.paletteNum = 0x0f,
static const struct WindowTemplate sWindowTemplate_5PlayerList = {
.bg = 0,
.tilemapLeft = 1,
.tilemapTop = 3,
.width = 13,
.height = 10,
.paletteNum = 15,
.baseBlock = 0x0044
};
static const struct WindowTemplate sWindowTemplate_NumPlayerMode = {
.bg = 0x00,
.tilemapLeft = 0x10,
.tilemapTop = 0x03,
.width = 0x07,
.height = 0x04,
.paletteNum = 0x0f,
.bg = 0,
.tilemapLeft = 16,
.tilemapTop = 3,
.width = 7,
.height = 4,
.paletteNum = 15,
.baseBlock = 0x00c6
};
const struct ListMenuItem gUnknown_082F0134[] = {
static const struct ListMenuItem sPossibleGroupMembersListMenuItems[] = {
{ sText_EmptyString, 0 },
{ sText_EmptyString, 1 },
{ sText_EmptyString, 2 },
@@ -686,10 +692,10 @@ const struct ListMenuItem gUnknown_082F0134[] = {
};
static const struct ListMenuTemplate sListMenuTemplate_PossibleGroupMembers = {
.items = gUnknown_082F0134,
.items = sPossibleGroupMembersListMenuItems,
.moveCursorFunc = NULL,
.itemPrintFunc = ItemPrintFunc_PossibleGroupMembers,
.totalItems = ARRAY_COUNT(gUnknown_082F0134),
.totalItems = ARRAY_COUNT(sPossibleGroupMembersListMenuItems),
.maxShowed = 5,
.windowId = 0,
.header_X = 0,
@@ -804,7 +810,7 @@ static const struct ListMenuTemplate sListMenuTemplate_InviteToActivity = {
.cursorKind = 0
};
const struct WindowTemplate gUnknown_082F025C = {
static const struct WindowTemplate sWindowTemplate_RegisterForTrade = {
.bg = 0x00,
.tilemapLeft = 0x12,
.tilemapTop = 0x07,
@@ -814,17 +820,17 @@ const struct WindowTemplate gUnknown_082F025C = {
.baseBlock = 0x0001
};
const struct ListMenuItem gUnknown_082F0264[] = {
static const struct ListMenuItem sRegisterForTradeListMenuItems[] = {
{ gText_Register, 1 },
{ sText_Info, 2 },
{ sText_Exit, 3 }
};
const struct ListMenuTemplate gUnknown_082F027C = {
.items = gUnknown_082F0264,
static const struct ListMenuTemplate sListMenuTemplate_RegisterForTrade = {
.items = sRegisterForTradeListMenuItems,
.moveCursorFunc = ListMenuDefaultCursorMoveFunc,
.itemPrintFunc = NULL,
.totalItems = ARRAY_COUNT(gUnknown_082F0264),
.totalItems = ARRAY_COUNT(sRegisterForTradeListMenuItems),
.maxShowed = 3,
.windowId = 0,
.header_X = 0,
@@ -872,7 +878,7 @@ static const struct ListMenuItem sTradingBoardTypes[NUMBER_OF_MON_TYPES] = {
{ sText_Exit, NUMBER_OF_MON_TYPES }
};
const struct ListMenuTemplate sMenuTemplate_TradingBoardRequestType = {
static const struct ListMenuTemplate sMenuTemplate_TradingBoardRequestType = {
.items = sTradingBoardTypes,
.moveCursorFunc = ListMenuDefaultCursorMoveFunc,
.itemPrintFunc = NULL,
@@ -893,7 +899,7 @@ const struct ListMenuTemplate sMenuTemplate_TradingBoardRequestType = {
.cursorKind = 0
};
const struct WindowTemplate gUnknown_082F0344 = {
static const struct WindowTemplate sWindowTemplate_TradingBoard = {
.bg = 0x00,
.tilemapLeft = 0x01,
.tilemapTop = 0x01,

View File

@@ -68,7 +68,7 @@ static void HandleBlockSend(void);
static void SendNextBlock(void);
static void SendLastBlock(void);
static u8 GetPartnerIndexByNameAndTrainerID(const u8 *, u16);
static void sub_8010750(void);
static void UpdateChildStatuses(void);
static s32 sub_80107A0(void);
static void sub_801084C(u8);
static void ClearSelectedLinkPlayerIds(u16);
@@ -278,7 +278,7 @@ void InitRFUAPI(void)
static void Task_LinkLeaderSearchForChildren(u8 taskId)
{
sub_8010750();
UpdateChildStatuses();
switch (Rfu.state)
{
case 0:
@@ -387,11 +387,11 @@ static void Task_JoinGroupSearchForParent(u8 taskId)
case 11:
switch (sub_80107A0())
{
case 5:
case RFU_STATUS_JOIN_GROUP_OK:
Rfu.state = 12;
break;
case 6:
case 9:
case RFU_STATUS_JOIN_GROUP_NO:
case RFU_STATUS_LEAVE_GROUP:
rfu_LMAN_requestChangeAgbClockMaster();
Rfu.unk_ce4 = 2;
DestroyTask(taskId);
@@ -444,11 +444,11 @@ static void sub_800EAFC(void)
static void Task_LinkRfu_UnionRoomListen(u8 taskId)
{
if (GetHostRFUtgtGname()->activity == (ACTIVITY_PLYRTALK | IN_UNION_ROOM) && RfuGetErrorStatus() == 4)
if (GetHostRFUtgtGname()->activity == (ACTIVITY_PLYRTALK | IN_UNION_ROOM) && RfuGetStatus() == RFU_STATUS_NEW_CHILD_DETECTED)
{
rfu_REQ_disconnect(lman.acceptSlot_flag);
rfu_waitREQComplete();
RfuSetErrorStatus(0, 0);
RfuSetStatus(RFU_STATUS_OK, 0);
}
switch (Rfu.state)
{
@@ -743,7 +743,7 @@ static bool32 sub_800F0F8(void)
Rfu.unk_ce3 = 0;
if (Rfu.unk_ce4 == 1)
{
RfuSetErrorStatus(2, 0x8000);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, 0x8000);
GetLinkmanErrorParams(0x8000);
return FALSE;
}
@@ -883,7 +883,7 @@ static bool32 RfuProcessEnqueuedRecvBlock(void)
u8 j;
u8 sp00[MAX_RFU_PLAYERS * (2 * (CMD_LENGTH - 1))];
u8 sp48[2 * (CMD_LENGTH - 1)];
u8 switchval;
u8 status;
RfuRecvQueue_Dequeue(&Rfu.recvQueue, sp00);
for (i = 0; i < MAX_RFU_PLAYERS; i++)
@@ -898,15 +898,15 @@ static bool32 RfuProcessEnqueuedRecvBlock(void)
{
rfu_REQ_disconnect(gRfuLinkStatus->connSlotFlag | gRfuLinkStatus->linkLossSlotFlag);
rfu_waitREQComplete();
switchval = RfuGetErrorStatus();
if (switchval != 1 && switchval != 6 && switchval != 9)
RfuSetErrorStatus(2, 0x9000);
status = RfuGetStatus();
if (status != RFU_STATUS_FATAL_ERROR && status != RFU_STATUS_JOIN_GROUP_NO && status != RFU_STATUS_LEAVE_GROUP)
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, 0x9000);
rfu_clearAllSlot();
gReceivedRemoteLinkPlayers = FALSE;
Rfu.callback = NULL;
if (Rfu.unk_ce4 == 1)
{
RfuSetErrorStatus(2, 0x9000);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, 0x9000);
GetLinkmanErrorParams(0x9000);
}
lman.state = lman.next_state = 0;
@@ -1231,7 +1231,7 @@ static void RfuPrepareSendBuffer(u16 command)
void sub_800FE50(void *a0)
{
if (gSendCmd[0] == 0 && !RfuIsErrorStatus1or2())
if (gSendCmd[0] == 0 && !RfuHasErrored())
{
memcpy(Rfu.unk_f2, a0, sizeof(Rfu.unk_f2));
RfuPrepareSendBuffer(RFU_COMMAND_0x2F00);
@@ -1535,7 +1535,7 @@ u8 Rfu_GetLinkPlayerCount(void)
bool8 IsLinkRfuTaskFinished(void)
{
if (Rfu.errorStatus == 2)
if (Rfu.status == RFU_STATUS_CONNECTION_ERROR)
return FALSE;
return Rfu.callback ? FALSE : TRUE;
}
@@ -1546,24 +1546,25 @@ static void CallRfuFunc(void)
Rfu.callback();
}
static bool8 sub_8010540(void)
static bool8 CheckForLeavingGroupMembers(void)
{
s32 i;
bool8 retval = FALSE;
bool8 memberLeft = FALSE;
for (i = 0; i < RFU_CHILD_MAX; i++)
{
if (Rfu.unk_cd1[i] < 5 || Rfu.unk_cd1[i] > 6)
if (Rfu.partnerSendStatuses[i] < RFU_STATUS_JOIN_GROUP_OK
|| Rfu.partnerSendStatuses[i] > RFU_STATUS_JOIN_GROUP_NO)
{
if (gRfuSlotStatusNI[i]->recv.state == SLOT_STATE_RECV_SUCCESS
|| gRfuSlotStatusNI[i]->recv.state == SLOT_STATE_RECV_SUCCESS_AND_SENDSIDE_UNKNOWN)
{
if (Rfu.unk_cd5[i] == 8)
if (Rfu.partnerRecvStatuses[i] == RFU_STATUS_LEAVE_GROUP_NOTICE)
{
Rfu.unk_cd1[i] = 9;
Rfu.unk_cd5[i] = 10;
Rfu.partnerSendStatuses[i] = RFU_STATUS_LEAVE_GROUP;
Rfu.partnerRecvStatuses[i] = RFU_STATUS_10;
rfu_clearSlot(TYPE_NI_RECV, i);
rfu_NI_setSendData(1 << i, 8, Rfu.unk_cd1 + i, 1);
retval = TRUE;
rfu_NI_setSendData(1 << i, 8, &Rfu.partnerSendStatuses[i], 1);
memberLeft = TRUE;
}
}
@@ -1574,7 +1575,7 @@ static bool8 sub_8010540(void)
}
}
}
return retval;
return memberLeft;
}
bool32 sub_80105EC(void)
@@ -1583,10 +1584,10 @@ bool32 sub_80105EC(void)
s32 i;
for (i = 0; i < RFU_CHILD_MAX; i++)
{
if (Rfu.unk_cd5[i] == 11)
if (Rfu.partnerRecvStatuses[i] == RFU_STATUS_11)
{
flags |= (1 << i);
Rfu.unk_cd5[i] = 0;
Rfu.partnerRecvStatuses[i] = RFU_STATUS_OK;
}
}
if (flags)
@@ -1596,40 +1597,41 @@ bool32 sub_80105EC(void)
}
for (i = 0; i < RFU_CHILD_MAX; i++)
{
if (Rfu.unk_cd5[i] == 10 || Rfu.unk_cd5[i] == 11)
if (Rfu.partnerRecvStatuses[i] == RFU_STATUS_10
|| Rfu.partnerRecvStatuses[i] == RFU_STATUS_11)
return TRUE;
}
return FALSE;
}
bool32 TrainerIdAndNameStillInPartnersList(u16 id, const u8 *name)
bool32 HasTrainerLeftPartnersList(u16 trainerId, const u8 *name)
{
u8 idx = GetPartnerIndexByNameAndTrainerID(name, id);
u8 idx = GetPartnerIndexByNameAndTrainerID(name, trainerId);
if (idx == 0xFF)
return TRUE;
if (Rfu.unk_cd1[idx] == 9)
if (Rfu.partnerSendStatuses[idx] == RFU_STATUS_LEAVE_GROUP)
return TRUE;
return FALSE;
}
void SendByteToPartnerByIdAndName(u8 value, u16 id, const u8 *name)
void SendRfuStatusToPartner(u8 status, u16 trainerId, const u8 *name)
{
u8 idx = GetPartnerIndexByNameAndTrainerID(name, id);
Rfu.unk_cd1[idx] = value;
u8 idx = GetPartnerIndexByNameAndTrainerID(name, trainerId);
Rfu.partnerSendStatuses[idx] = status;
rfu_clearSlot(TYPE_NI_SEND, idx);
rfu_NI_setSendData(1 << idx, 8, Rfu.unk_cd1 + idx, 1);
rfu_NI_setSendData(1 << idx, 8, &Rfu.partnerSendStatuses[idx], 1);
}
void LinkRfuNIsend8(void)
void SendLeaveGroupNotice(void)
{
Rfu.unk_c85 = 8;
Rfu.unk_c85 = RFU_STATUS_LEAVE_GROUP_NOTICE;
rfu_clearSlot(TYPE_NI_SEND, Rfu.childSlot);
rfu_NI_setSendData(1 << Rfu.childSlot, 8, &Rfu.unk_c85, 1);
}
u32 WaitSendByteToPartnerByIdAndName(u16 id, const u8 *name)
u32 WaitSendRfuStatusToPartner(u16 trainerId, const u8 *name)
{
u8 idx = GetPartnerIndexByNameAndTrainerID(name, id);
u8 idx = GetPartnerIndexByNameAndTrainerID(name, trainerId);
if (idx == 0xFF)
return 2;
if (gRfuSlotStatusNI[idx]->send.state == 0)
@@ -1637,18 +1639,18 @@ u32 WaitSendByteToPartnerByIdAndName(u16 id, const u8 *name)
return 0;
}
static void sub_8010750(void)
static void UpdateChildStatuses(void)
{
s32 i;
sub_8010540();
CheckForLeavingGroupMembers();
for (i = 0; i < RFU_CHILD_MAX; i++)
{
if (gRfuSlotStatusNI[i]->send.state == SLOT_STATE_SEND_SUCCESS
|| gRfuSlotStatusNI[i]->send.state == SLOT_STATE_SEND_FAILED)
{
if (Rfu.unk_cd5[i] == 10)
Rfu.unk_cd5[i] = 11;
if (Rfu.partnerRecvStatuses[i] == RFU_STATUS_10)
Rfu.partnerRecvStatuses[i] = RFU_STATUS_11;
rfu_clearSlot(TYPE_NI_SEND, i);
}
}
@@ -1656,7 +1658,7 @@ static void sub_8010750(void)
static s32 sub_80107A0(void)
{
s32 retval = 0;
s32 status = RFU_STATUS_OK;
if (Rfu.unk_c85 == 8)
{
if (gRfuSlotStatusNI[Rfu.childSlot]->send.state == SLOT_STATE_SEND_SUCCESS
@@ -1667,22 +1669,22 @@ static s32 sub_80107A0(void)
|| gRfuSlotStatusNI[Rfu.childSlot]->recv.state == SLOT_STATE_RECV_SUCCESS_AND_SENDSIDE_UNKNOWN)
{
rfu_clearSlot(TYPE_NI_RECV, Rfu.childSlot);
RfuSetErrorStatus(Rfu.unk_c86, 0);
retval = Rfu.unk_c86;
RfuSetStatus(Rfu.recvStatus, 0);
status = Rfu.recvStatus;
}
else if (gRfuSlotStatusNI[Rfu.childSlot]->recv.state == SLOT_STATE_RECV_FAILED)
{
rfu_clearSlot(TYPE_NI_RECV, Rfu.childSlot);
retval = 6;
status = RFU_STATUS_JOIN_GROUP_NO;
}
return retval;
return status;
}
static void sub_801084C(u8 taskId)
{
s32 i;
if (Rfu.errorStatus == 1 || Rfu.errorStatus == 2)
if (Rfu.status == RFU_STATUS_FATAL_ERROR || Rfu.status == RFU_STATUS_CONNECTION_ERROR)
{
Rfu.unk_ce8 = 0;
DestroyTask(taskId);
@@ -1802,7 +1804,7 @@ static void Task_ExchangeLinkPlayers(u8 taskId)
struct LinkPlayerBlock *r2;
struct SioInfo *r5;
u8 r4 = Rfu.linkPlayerIdx[sUnknown_082ED68C[Rfu.unk_ce9]];
if (Rfu.errorStatus == 1 || Rfu.errorStatus == 2)
if (Rfu.status == RFU_STATUS_FATAL_ERROR || Rfu.status == RFU_STATUS_CONNECTION_ERROR)
{
Rfu.unk_ce8 = 0;
DestroyTask(taskId);
@@ -1876,7 +1878,7 @@ static void Task_ExchangeLinkPlayers(u8 taskId)
static void sub_8010D0C(u8 taskId)
{
if (Rfu.errorStatus == 1 || Rfu.errorStatus == 2)
if (Rfu.status == RFU_STATUS_FATAL_ERROR || Rfu.status == RFU_STATUS_CONNECTION_ERROR)
DestroyTask(taskId);
switch (gTasks[taskId].data[0])
{
@@ -1912,7 +1914,7 @@ static void RfuCheckErrorStatus(void)
gWirelessCommType = 2;
SetMainCallback2(CB2_LinkError);
gMain.savedCallback = CB2_LinkError;
BufferLinkErrorInfo((Rfu.linkmanMsg << 16) | (Rfu.unk_10 << 8) | Rfu.unk_12, Rfu.recvQueue.count, Rfu.sendQueue.count, RfuGetErrorStatus() == 2);
BufferLinkErrorInfo((Rfu.linkmanMsg << 16) | (Rfu.unk_10 << 8) | Rfu.unk_12, Rfu.recvQueue.count, Rfu.sendQueue.count, RfuGetStatus() == RFU_STATUS_CONNECTION_ERROR);
Rfu.errorState = 2;
CloseLink();
}
@@ -1920,7 +1922,7 @@ static void RfuCheckErrorStatus(void)
{
if (lman.childClockSlave_flag)
rfu_LMAN_requestChangeAgbClockMaster();
RfuSetErrorStatus(1, 0x7000);
RfuSetStatus(RFU_STATUS_FATAL_ERROR, 0x7000);
GetLinkmanErrorParams(0x7000);
}
}
@@ -1981,7 +1983,7 @@ void ClearAndInitHostRFUtgtGname(void)
InitHostRFUtgtGname(&gHostRFUtgtGnameBuffer, ACTIVITY_NONE, FALSE, 0);
}
void SetHostRFUtgtGname(u8 activity, u32 child_sprite_genders, u32 started)
void SetHostRFUtgtGname(u8 activity, u32 child_sprite_genders, bool32 started)
{
InitHostRFUtgtGname(&gHostRFUtgtGnameBuffer, activity, started, child_sprite_genders);
}
@@ -2016,16 +2018,16 @@ void sub_801103C(void)
r5->child_sprite_gender[i - 1] = sub_801100C(i);
}
void UpdateGameData_GroupLockedIn(u8 a0)
void UpdateGameData_GroupLockedIn(bool8 started)
{
gHostRFUtgtGnameBuffer.started = a0;
gHostRFUtgtGnameBuffer.started = started;
rfu_REQ_configGameData(0, 2, (void *)&gHostRFUtgtGnameBuffer, gHostRFUtgtUnameBuffer);
}
void UpdateGameDataWithActivitySpriteGendersFlag(u8 a0, u32 a1, u32 a2)
void UpdateGameData_SetActivity(u8 activity, u32 flags, bool32 started)
{
if (a0)
SetHostRFUtgtGname(a0, a1, a2);
if (activity != ACTIVITY_NONE)
SetHostRFUtgtGname(activity, flags, started);
rfu_REQ_configGameData(0, 2, (void *)&gHostRFUtgtGnameBuffer, gHostRFUtgtUnameBuffer);
}
@@ -2051,7 +2053,7 @@ void sub_80110B8(u32 a0)
break;
}
}
UpdateGameDataWithActivitySpriteGendersFlag((ACTIVITY_CHAT | IN_UNION_ROOM), child_sprite_genders, 0);
UpdateGameData_SetActivity((ACTIVITY_CHAT | IN_UNION_ROOM), child_sprite_genders, FALSE);
}
}
@@ -2110,9 +2112,9 @@ static void sub_801120C(u8 msg, u8 paramCount)
struct GFtgtGname *structPtr = (void *)gRfuLinkStatus->partner[i].gname;
if (structPtr->activity == GetHostRFUtgtGname()->activity)
{
Rfu.unk_cd1[i] = 0;
Rfu.unk_cd5[i] = 0;
rfu_setRecvBuffer(TYPE_NI, i, Rfu.unk_cd5 + i, 1);
Rfu.partnerSendStatuses[i] = RFU_STATUS_OK;
Rfu.partnerRecvStatuses[i] = RFU_STATUS_OK;
rfu_setRecvBuffer(TYPE_NI, i, &Rfu.partnerRecvStatuses[i], 1);
}
else
{
@@ -2155,7 +2157,7 @@ static void sub_801120C(u8 msg, u8 paramCount)
else
sub_80111FC();
}
RfuSetErrorStatus(2, msg);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, msg);
break;
case 0x34:
break;
@@ -2164,7 +2166,7 @@ static void sub_801120C(u8 msg, u8 paramCount)
case LMAN_MSG_MANAGER_FORCED_STOPPED_AND_RFU_RESET:
break;
case LMAN_MSG_LMAN_API_ERROR_RETURN:
RfuSetErrorStatus(1, msg);
RfuSetStatus(RFU_STATUS_FATAL_ERROR, msg);
GetLinkmanErrorParams(msg);
Rfu.isShuttingDown = TRUE;
break;
@@ -2173,7 +2175,7 @@ static void sub_801120C(u8 msg, u8 paramCount)
case LMAN_MSG_CLOCK_SLAVE_MS_CHANGE_ERROR_BY_DMA:
case LMAN_MSG_RFU_FATAL_ERROR:
GetLinkmanErrorParams(msg);
RfuSetErrorStatus(1, msg);
RfuSetStatus(RFU_STATUS_FATAL_ERROR, msg);
Rfu.unk_cdb = TRUE;
break;
}
@@ -2195,27 +2197,27 @@ void sub_8011404(u8 msg, u8 unused1)
Rfu.childSlot = lman.param[0];
break;
case LMAN_MSG_CONNECT_PARENT_FAILED:
RfuSetErrorStatus(2, msg);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, msg);
break;
case LMAN_MSG_CHILD_NAME_SEND_COMPLETED:
Rfu.state = 11;
Rfu.unk_c85 = 0;
Rfu.unk_c86 = 0;
rfu_setRecvBuffer(TYPE_NI, Rfu.childSlot, &Rfu.unk_c86, 1);
Rfu.recvStatus = RFU_STATUS_OK;
rfu_setRecvBuffer(TYPE_NI, Rfu.childSlot, &Rfu.recvStatus, 1);
rfu_setRecvBuffer(TYPE_UNI, Rfu.childSlot, Rfu.unk_c3f, 70);
break;
case LMAN_MSG_CHILD_NAME_SEND_FAILED_AND_DISCONNECTED:
RfuSetErrorStatus(2, msg);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, msg);
break;
case LMAN_MSG_LINK_LOSS_DETECTED_AND_DISCONNECTED:
Rfu.linkLossRecoveryState = 2;
if (Rfu.unk_c86 == 6)
if (Rfu.recvStatus == RFU_STATUS_JOIN_GROUP_NO)
break;
case LMAN_MSG_LINK_RECOVERY_FAILED_AND_DISCONNECTED:
if (Rfu.linkLossRecoveryState != 2)
Rfu.linkLossRecoveryState = 4;
if (Rfu.unk_c86 != 9)
RfuSetErrorStatus(2, msg);
if (Rfu.recvStatus != RFU_STATUS_LEAVE_GROUP)
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, msg);
Debug_PrintString(sASCII_LinkLossDisconnect, 5, 5);
if (gReceivedRemoteLinkPlayers == 1)
GetLinkmanErrorParams(msg);
@@ -2235,7 +2237,7 @@ void sub_8011404(u8 msg, u8 unused1)
case LMAN_MSG_MANAGER_FORCED_STOPPED_AND_RFU_RESET:
break;
case LMAN_MSG_LMAN_API_ERROR_RETURN:
RfuSetErrorStatus(1, msg);
RfuSetStatus(RFU_STATUS_FATAL_ERROR, msg);
GetLinkmanErrorParams(msg);
Rfu.isShuttingDown = TRUE;
break;
@@ -2243,7 +2245,7 @@ void sub_8011404(u8 msg, u8 unused1)
case LMAN_MSG_WATCH_DOG_TIMER_ERROR:
case LMAN_MSG_CLOCK_SLAVE_MS_CHANGE_ERROR_BY_DMA:
case LMAN_MSG_RFU_FATAL_ERROR:
RfuSetErrorStatus(1, msg);
RfuSetStatus(RFU_STATUS_FATAL_ERROR, msg);
GetLinkmanErrorParams(msg);
Rfu.unk_cdb = TRUE;
break;
@@ -2292,7 +2294,7 @@ static void sub_8011674(u8 msg, u8 paramCount)
Rfu.state = 17;
break;
case LMAN_MSG_NEW_CHILD_CONNECT_DETECTED:
RfuSetErrorStatus(4, 0);
RfuSetStatus(RFU_STATUS_NEW_CHILD_DETECTED, 0);
break;
case LMAN_MSG_NEW_CHILD_CONNECT_ACCEPTED:
if (GetHostRFUtgtGname()->activity == (ACTIVITY_CHAT | IN_UNION_ROOM) && Rfu.unk_cd9 == 0)
@@ -2357,16 +2359,16 @@ static void sub_8011674(u8 msg, u8 paramCount)
}
else
{
RfuSetErrorStatus(2, msg);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, msg);
}
break;
case LMAN_MSG_CHILD_NAME_SEND_COMPLETED:
Rfu.state = 13;
RfuSetErrorStatus(3, 0);
RfuSetStatus(RFU_STATUS_CHILD_SEND_COMPLETE, 0);
rfu_setRecvBuffer(TYPE_UNI, Rfu.childSlot, Rfu.unk_c3f, 70);
break;
case LMAN_MSG_CHILD_NAME_SEND_FAILED_AND_DISCONNECTED:
RfuSetErrorStatus(2, msg);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, msg);
break;
case LMAN_MSG_LINK_LOSS_DETECTED_AND_START_RECOVERY:
if (lman.acceptSlot_flag & lman.param[0])
@@ -2402,7 +2404,7 @@ static void sub_8011674(u8 msg, u8 paramCount)
if (gRfuLinkStatus->parentChild == MODE_NEUTRAL && lman.pcswitch_flag == 0 && FuncIsActiveTask(Task_LinkRfu_UnionRoomListen) == TRUE)
Rfu.state = 17;
RfuSetErrorStatus(2, msg);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, msg);
break;
case LMAN_MSG_LINK_DISCONNECTED_BY_USER:
Rfu.unk_ce3 = 0;
@@ -2412,7 +2414,7 @@ static void sub_8011674(u8 msg, u8 paramCount)
case LMAN_MSG_MANAGER_FORCED_STOPPED_AND_RFU_RESET:
break;
case LMAN_MSG_LMAN_API_ERROR_RETURN:
RfuSetErrorStatus(1, msg);
RfuSetStatus(RFU_STATUS_FATAL_ERROR, msg);
GetLinkmanErrorParams(msg);
Rfu.isShuttingDown = TRUE;
break;
@@ -2421,7 +2423,7 @@ static void sub_8011674(u8 msg, u8 paramCount)
case LMAN_MSG_CLOCK_SLAVE_MS_CHANGE_ERROR_BY_DMA:
case LMAN_MSG_RFU_FATAL_ERROR:
GetLinkmanErrorParams(msg);
RfuSetErrorStatus(1, msg);
RfuSetStatus(RFU_STATUS_FATAL_ERROR, msg);
Rfu.unk_cdb = FALSE;
break;
}
@@ -2432,21 +2434,22 @@ void sub_8011A50(void)
Rfu.unk_ce4 = 2;
}
void RfuSetErrorStatus(u8 status, u16 msg)
void RfuSetStatus(u8 status, u16 msg)
{
Rfu.errorStatus = status;
Rfu.status = status;
Rfu.linkmanMsg = msg;
}
u8 RfuGetErrorStatus(void)
u8 RfuGetStatus(void)
{
return Rfu.errorStatus;
return Rfu.status;
}
bool32 RfuIsErrorStatus1or2(void)
bool32 RfuHasErrored(void)
{
u32 var = RfuGetErrorStatus() - 1;
if (var < 2)
// RFU_STATUS_OK will underflow here intentionally
u32 var = RfuGetStatus() - 1;
if (var < RFU_STATUS_CONNECTION_ERROR)
return TRUE;
else
return FALSE;
@@ -2673,7 +2676,7 @@ static void Task_RfuReconnectWithParent(u8 taskId)
}
else
{
RfuSetErrorStatus(2, 0x7000);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, 0x7000);
DestroyTask(taskId);
}
}
@@ -2690,7 +2693,7 @@ static void Task_RfuReconnectWithParent(u8 taskId)
if (data[15] > 240)
{
RfuSetErrorStatus(2, 0x7000);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, 0x7000);
DestroyTask(taskId);
}
}
@@ -2700,7 +2703,7 @@ void CreateTask_RfuReconnectWithParent(const u8 *name, u16 trainerId)
u8 taskId;
s16 *data;
Rfu.errorStatus = 0;
Rfu.status = RFU_STATUS_OK;
taskId = CreateTask(Task_RfuReconnectWithParent, 3);
data = gTasks[taskId].data;
StringCopy((u8*)(data), name);
@@ -2741,12 +2744,12 @@ static bool32 ShouldRejectPartnerConnectionBasedOnActivity(s16 activity, struct
static void sub_801209C(u8 taskId)
{
if (Rfu.errorStatus == 4)
if (Rfu.status == RFU_STATUS_NEW_CHILD_DETECTED)
DestroyTask(taskId);
if (++gTasks[taskId].data[0] > 300)
{
RfuSetErrorStatus(2, 0x7000);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, 0x7000);
DestroyTask(taskId);
}
@@ -2766,7 +2769,7 @@ static void sub_801209C(u8 taskId)
}
else
{
RfuSetErrorStatus(2, 0x7000);
RfuSetStatus(RFU_STATUS_CONNECTION_ERROR, 0x7000);
DestroyTask(taskId);
}
}
@@ -2778,7 +2781,7 @@ void sub_8012188(const u8 *name, struct GFtgtGname *structPtr, u8 activity)
u8 taskId, taskId2;
Rfu.unk_ccf = 0;
Rfu.errorStatus = 0;
Rfu.status = RFU_STATUS_OK;
StringCopy(Rfu.playerName, name);
memcpy(&Rfu.unk_10A, structPtr, RFU_GAME_NAME_LENGTH);
rfu_LMAN_forceChangeSP();
@@ -2811,7 +2814,7 @@ bool32 sub_8012240(void)
for (i = 0; i < RFU_CHILD_MAX; i++)
{
if ((lman.acceptSlot_flag >> i) & 1 && Rfu.unk_cd1[i] == 0)
if ((lman.acceptSlot_flag >> i) & 1 && Rfu.partnerSendStatuses[i] == RFU_STATUS_OK)
return FALSE;
}
@@ -2846,7 +2849,7 @@ static void Debug_PrintStatus(void)
}
for (i = 0; i < RFU_CHILD_MAX; i++)
{
for (j = 0; j < 14; j++)
for (j = 0; j < (int)ARRAY_COUNT(Rfu.unk_14[0]); j++)
{
Debug_PrintNum(Rfu.unk_14[i][j], j * 2, i + 11, 2);
}

View File

@@ -953,7 +953,7 @@ void UpdateWirelessStatusIndicatorSprite(void)
gMain.oamBuffer[125].paletteNum = sprite->oam.paletteNum;
gMain.oamBuffer[125].tileNum = sprite->sTileStart + sprite->anims[sprite->sCurrAnimNum][sprite->sFrameIdx].frame.imageValue;
CpuCopy16(gMain.oamBuffer + 125, (struct OamData *)OAM + 125, sizeof(struct OamData));
if (RfuGetErrorStatus() == 1)
if (RfuGetStatus() == RFU_STATUS_FATAL_ERROR)
{
DestroyWirelessStatusIndicatorSprite();
}

View File

@@ -30,6 +30,7 @@
#include "link_rfu.h"
#include "mevent_news.h"
#include "mevent_server.h"
#include "constants/cable_club.h"
void bgid_upload_textbox_1(u8 bgId);
void task_add_00_mystery_gift(void);
@@ -1242,21 +1243,21 @@ void task00_mystery_gift(u8 taskId)
case 0:
if (data->source == 1)
{
MEvent_CreateTask_CardOrNewsWithFriend(0x15);
MEvent_CreateTask_CardOrNewsWithFriend(ACTIVITY_WONDER_CARD2);
}
else if (data->source == 0)
{
MEvent_CreateTask_CardOrNewsOverWireless(0x15);
MEvent_CreateTask_CardOrNewsOverWireless(ACTIVITY_WONDER_CARD2);
}
break;
case 1:
if (data->source == 1)
{
MEvent_CreateTask_CardOrNewsWithFriend(0x16);
MEvent_CreateTask_CardOrNewsWithFriend(ACTIVITY_WONDER_NEWS2);
}
else if (data->source == 0)
{
MEvent_CreateTask_CardOrNewsOverWireless(0x16);
MEvent_CreateTask_CardOrNewsOverWireless(ACTIVITY_WONDER_NEWS2);
}
break;
}
@@ -1269,7 +1270,7 @@ void task00_mystery_gift(u8 taskId)
data->state = 7;
mevent_client_do_init(data->IsCardOrNews);
}
else if (gSpecialVar_Result == 5)
else if (gSpecialVar_Result == LINKUP_FAILED)
{
ClearScreenInBg0(TRUE);
data->state = 3;
@@ -1599,10 +1600,10 @@ void task00_mystery_gift(u8 taskId)
switch (data->IsCardOrNews)
{
case 0:
MEvent_CreateTask_Leader(21);
MEvent_CreateTask_Leader(ACTIVITY_WONDER_CARD2);
break;
case 1:
MEvent_CreateTask_Leader(22);
MEvent_CreateTask_Leader(ACTIVITY_WONDER_NEWS2);
break;
}
data->source = 1;
@@ -1615,7 +1616,7 @@ void task00_mystery_gift(u8 taskId)
ClearScreenInBg0(1);
data->state = 31;
}
else if (gSpecialVar_Result == 5)
else if (gSpecialVar_Result == LINKUP_FAILED)
{
ClearScreenInBg0(1);
data->state = 18;

View File

@@ -525,7 +525,7 @@ void Task_ShowStartMenu(u8 taskId)
{
case 0:
if (InUnionRoom() == TRUE)
var_800D_set_xB();
SetUsingUnionRoomStartMenu();
gMenuCallback = HandleStartMenuInput;
task->data[0]++;

File diff suppressed because it is too large Load Diff

View File

@@ -78,7 +78,7 @@ static const u8 sNextFacingDirection[] = {
[DIR_EAST] = DIR_NORTH
};
// Local id 1 is the Nurse/Aide
// Local id 1 is the Nurse/Attendant, 2-9 are link players
static const u8 sUnionRoomLocalIds[] = { 9, 8, 7, 2, 6, 5, 4, 3 };
static const u16 sUnknown[] = {
@@ -102,9 +102,9 @@ static const u8 sMovement_UnionPlayerEnter[2] = {
MOVEMENT_ACTION_STEP_END
};
static bool32 is_walking_or_running(void)
static bool32 IsPlayerStandingStill(void)
{
if (gPlayerAvatar.tileTransitionState == 2 || gPlayerAvatar.tileTransitionState == 0)
if (gPlayerAvatar.tileTransitionState == T_TILE_CENTER || gPlayerAvatar.tileTransitionState == T_NOT_MOVING)
return TRUE;
else
return FALSE;
@@ -251,7 +251,7 @@ static bool32 AnimateUnionRoomPlayerSpawn(s8 * state, u32 playerIdx, struct Unio
switch (*state)
{
case 0:
if (!is_walking_or_running())
if (!IsPlayerStandingStill())
{
break;
}
@@ -567,12 +567,12 @@ void HandleUnionRoomPlayerRefresh(struct WirelessLink_URoom *uroom)
}
}
bool32 TrySetUnionRoomMemberFacePlayer(struct UnkStruct_Main0 *main0, s16 *directionPtr, s16 *playerIdxPtr, u8 *spriteIds)
bool32 TryInteractWithUnionRoomMember(struct UnkStruct_Main0 *main0, s16 *directionPtr, s16 *playerIdxPtr, u8 *spriteIds)
{
s16 x, y;
s32 i, direction;
struct UnkStruct_x20 * r4;
if (!is_walking_or_running())
if (!IsPlayerStandingStill())
{
return FALSE;
}
@@ -602,6 +602,7 @@ bool32 TrySetUnionRoomMemberFacePlayer(struct UnkStruct_Main0 *main0, s16 *direc
{
continue;
}
// Face player
SetUnionRoomObjectFacingDirection(direction, i, sOppositeFacingDirection[GetPlayerFacingDirection()]);
*directionPtr = direction;
*playerIdxPtr = i;