From c7e3e7ffea21d181550e98ab15364b69f0447a5b Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 27 Dec 2024 01:32:02 -0800 Subject: [PATCH] small fixes --- include/d/d_com_inf_game.h | 6 +++--- src/d/d_com_inf_game.cpp | 20 ++++++++++---------- src/d/d_event.cpp | 24 ++++++++++++------------ 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index b85c83468..b5b0d0257 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -1597,7 +1597,7 @@ inline BOOL dComIfGs_checkEmptyBottle() { inline BOOL dComIfGs_checkGetBottle() { u8 bottleCount = 0; for (int i = 0; i < 4; i++) { - if (dComIfGs_getItem(0xE + i) != 0xFF) { + if (dComIfGs_getItem(dInvSlot_BOTTLE0_e + i) != dItem_NONE_e) { bottleCount++; } } @@ -2482,11 +2482,11 @@ inline void dComIfGp_setSelectItem(int i_btnIdx) { invIdx = dComIfGs_getSelectItem(i_btnIdx); itemNo = dComIfGs_getItem(invIdx); - if (itemNo == 0xFF) { + if (itemNo == dItem_NONE_e) { dComIfGs_setSelectItem(i_btnIdx, dInvSlot_NONE_e); } } else { - g_dComIfG_gameInfo.play.setSelectItem(i_btnIdx, dInvSlot_NONE_e); + g_dComIfG_gameInfo.play.setSelectItem(i_btnIdx, dItem_NONE_e); } } diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 17a532ac1..59ce40a47 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -1322,11 +1322,11 @@ void dComIfGs_setPlayerRecollectionData() { tmp_sttsA.mSelectEquip[3] = dComIfGs_getSelectEquip(3); tmp_sttsA.mSelectEquip[4] = dComIfGs_getSelectEquip(4); - tmp_item.mItems[14] = dComIfGs_getItem(14); - tmp_item.mItems[15] = dComIfGs_getItem(15); - tmp_item.mItems[16] = dComIfGs_getItem(16); - tmp_item.mItems[17] = dComIfGs_getItem(17); - tmp_item.mItems[8] = dComIfGs_getItem(8); + tmp_item.mItems[dInvSlot_BOTTLE0_e] = dComIfGs_getItem(dInvSlot_BOTTLE0_e); + tmp_item.mItems[dInvSlot_BOTTLE1_e] = dComIfGs_getItem(dInvSlot_BOTTLE1_e); + tmp_item.mItems[dInvSlot_BOTTLE2_e] = dComIfGs_getItem(dInvSlot_BOTTLE2_e); + tmp_item.mItems[dInvSlot_BOTTLE3_e] = dComIfGs_getItem(dInvSlot_BOTTLE3_e); + tmp_item.mItems[dInvSlot_CAMERA_e] = dComIfGs_getItem(dInvSlot_CAMERA_e); // TODO: This matches but could probably be cleaned up somehow. dSv_player_status_c_c* stts = dComIfGs_getpPlayerStatusC(tbl); @@ -1430,11 +1430,11 @@ void dComIfGs_revPlayerRecollectionData() { tmp_sttsA.mSelectEquip[3] = dComIfGs_getSelectEquip(3); tmp_sttsA.mSelectEquip[4] = dComIfGs_getSelectEquip(4); - tmp_item.mItems[14] = dComIfGs_getItem(14); - tmp_item.mItems[15] = dComIfGs_getItem(15); - tmp_item.mItems[16] = dComIfGs_getItem(16); - tmp_item.mItems[17] = dComIfGs_getItem(17); - tmp_item.mItems[8] = dComIfGs_getItem(8); + tmp_item.mItems[dInvSlot_BOTTLE0_e] = dComIfGs_getItem(dInvSlot_BOTTLE0_e); + tmp_item.mItems[dInvSlot_BOTTLE1_e] = dComIfGs_getItem(dInvSlot_BOTTLE1_e); + tmp_item.mItems[dInvSlot_BOTTLE2_e] = dComIfGs_getItem(dInvSlot_BOTTLE2_e); + tmp_item.mItems[dInvSlot_BOTTLE3_e] = dComIfGs_getItem(dInvSlot_BOTTLE3_e); + tmp_item.mItems[dInvSlot_CAMERA_e] = dComIfGs_getItem(dInvSlot_CAMERA_e); // TODO: This matches but could probably be cleaned up somehow. u32 buffer = (u32)dComIfGp_getPlayerInfoBuffer(); diff --git a/src/d/d_event.cpp b/src/d/d_event.cpp index 1003a7ba6..6f208f5bc 100644 --- a/src/d/d_event.cpp +++ b/src/d/d_event.cpp @@ -82,7 +82,7 @@ void dEvt_control_c::setParam(dEvt_order_c* order) { mPtTalk = getPId(order->mActor2); mPtItem = getPId(order->mActor2); } - + mEventInfoIdx = order->mEventInfoIdx; if (order->mEventInfoIdx == 0xFF || stageEventInfo == NULL || order->mEventInfoIdx >= stageEventInfo->num) @@ -154,9 +154,9 @@ BOOL dEvt_control_c::talkCheck(dEvt_order_c* order) { /* 80070390-8007055C .text talkXyCheck__14dEvt_control_cFP12dEvt_order_c */ BOOL dEvt_control_c::talkXyCheck(dEvt_order_c* order) { const char* defaultEventName = "DEFAULT_TALK_XY"; - + fopAc_ac_c* actor2 = order->mActor2; - + int equippedItemIdx; switch (order->mEventType) { case dEvtType_SHOWITEM_X_e: @@ -169,19 +169,19 @@ BOOL dEvt_control_c::talkXyCheck(dEvt_order_c* order) { equippedItemIdx = 2; break; } - + if (dComIfGp_getSelectItem(equippedItemIdx) == dItem_NONE_e) { return FALSE; } - + if (actor2 == NULL || !actor2->eventInfo.chkCondition(dEvtCnd_CANTALKITEM_e)) { return FALSE; } - + if (commonCheck(order, dEvtCnd_CANTALK_e, dEvtCmd_INTALK_e)) { mMode = dEvtMode_TALK_e; mItemNo = dComIfGp_getSelectItem(equippedItemIdx); - + switch (order->mEventType) { case dEvtType_SHOWITEM_X_e: mTalkButton = 1; @@ -193,7 +193,7 @@ BOOL dEvt_control_c::talkXyCheck(dEvt_order_c* order) { mTalkButton = 3; break; } - + // Fakematch s16 r3; if (actor2 != NULL && (r3 = actor2->eventInfo.runXyEventCB(actor2, equippedItemIdx), r3 != -1)) { @@ -201,13 +201,13 @@ BOOL dEvt_control_c::talkXyCheck(dEvt_order_c* order) { } else { mEventId = dComIfGp_evmng_getEventIdx(defaultEventName); } - + if (!dComIfGp_evmng_order(mEventId)) { JUT_ASSERT(401, FALSE); } return TRUE; } - + return FALSE; } @@ -576,7 +576,7 @@ BOOL dEvt_control_c::photoCheck() { equippedItemIdx = 2; break; } - + if (equippedItemIdx != -1 && (dComIfGp_getSelectItem(equippedItemIdx) == CAMERA || dComIfGp_getSelectItem(equippedItemIdx) == CAMERA2) && dComIfGs_getPictureNum() != 0 @@ -605,7 +605,7 @@ BOOL dEvt_control_c::photoCheck() { return TRUE; } } - + return FALSE; }