Skip to content

Commit 504e128

Browse files
committed
match PMDM autoEquip
1 parent bfb94a3 commit 504e128

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

data/uking_functions.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56389,7 +56389,7 @@ Address,Quality,Size,Name
5638956389
0x0000007100970060,O,000248,_ZN5uking2ui16PauseMenuDataMgr11cookItemGetERKNS_8CookItemE
5639056390
0x0000007100970158,O,000268,_ZN5uking2ui16PauseMenuDataMgr26setCookDataOnLastAddedItemERKNS_8CookItemE
5639156391
0x0000007100970264,O,000116,_ZN5uking2ui16PauseMenuDataMgr22autoEquipLastAddedItemEv
56392-
0x00000071009702d8,m,000268,_ZN5uking2ui16PauseMenuDataMgr9autoEquipEPNS0_9PouchItemERKN4sead10OffsetListIS2_EE
56392+
0x00000071009702d8,O,000268,_ZN5uking2ui16PauseMenuDataMgr9autoEquipEPNS0_9PouchItemERKN4sead10OffsetListIS2_EE
5639356393
0x00000071009703e4,m,000216,_ZN5uking2ui16PauseMenuDataMgr10unequipAllENS0_13PouchItemTypeE
5639456394
0x00000071009704bc,O,001352,_ZN5uking2ui16PauseMenuDataMgr10removeItemERKN4sead14SafeStringBaseIcEE
5639556395
0x0000007100970a04,O,000896,_ZN5uking2ui16PauseMenuDataMgr22removeWeaponIfEquippedERKN4sead14SafeStringBaseIcEE

src/Game/UI/uiPauseMenuDataMgr.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,20 +1064,30 @@ const sead::SafeString& PauseMenuDataMgr::autoEquip(PouchItem* item,
10641064
if (type >= PouchItemType::Material)
10651065
return sead::SafeString::cEmptyString;
10661066

1067-
if (isPouchItemArmor(type)) {
1067+
switch (type) {
1068+
case PouchItemType::Sword:
1069+
case PouchItemType::Bow:
1070+
case PouchItemType::Shield:
1071+
case PouchItemType::Arrow:
10681072
for (auto& other : list) {
1069-
if (other.getType() > PouchItemType::ArmorLower)
1073+
if (other.getType() > PouchItemType::Shield)
10701074
break;
10711075
if (other.getType() == type)
10721076
other.mEquipped = false;
10731077
}
1074-
} else if (isPouchItemWeapon(type)) {
1078+
break;
1079+
case PouchItemType::ArmorHead:
1080+
case PouchItemType::ArmorUpper:
1081+
case PouchItemType::ArmorLower:
10751082
for (auto& other : list) {
1076-
if (other.getType() > PouchItemType::Shield)
1083+
if (other.getType() > PouchItemType::ArmorLower)
10771084
break;
10781085
if (other.getType() == type)
10791086
other.mEquipped = false;
10801087
}
1088+
break;
1089+
default:
1090+
break;
10811091
}
10821092

10831093
item->mEquipped = true;

0 commit comments

Comments
 (0)