Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
magcius committed Dec 27, 2024
1 parent 929027b commit c7e3e7f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions include/d/d_com_inf_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
}
Expand Down Expand Up @@ -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);
}
}

Expand Down
20 changes: 10 additions & 10 deletions src/d/d_com_inf_game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
24 changes: 12 additions & 12 deletions src/d/d_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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;
Expand All @@ -193,21 +193,21 @@ 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)) {
mEventId = r3;
} else {
mEventId = dComIfGp_evmng_getEventIdx(defaultEventName);
}

if (!dComIfGp_evmng_order(mEventId)) {
JUT_ASSERT(401, FALSE);
}
return TRUE;
}

return FALSE;
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -605,7 +605,7 @@ BOOL dEvt_control_c::photoCheck() {
return TRUE;
}
}

return FALSE;
}

Expand Down

0 comments on commit c7e3e7f

Please sign in to comment.