mirror of https://github.com/zeldaret/botw.git
Match PauseMenuDataMgr::removeGrabbedItem
This commit is contained in:
parent
a1fd80bd1c
commit
63bf3d2fa4
|
@ -56356,7 +56356,7 @@ Address,Quality,Size,Name
|
|||
0x00000071009717f8,O,000404,_ZNK5uking2ui16PauseMenuDataMgr7hasItemERKN4sead14SafeStringBaseIcEE
|
||||
0x000000710097198c,O,000372,_ZNK5uking2ui16PauseMenuDataMgr14getMasterSwordEv
|
||||
0x0000007100971b00,O,000620,_ZN5uking2ui16PauseMenuDataMgr18removeGrabbedItemsEv
|
||||
0x0000007100971d6c,M,001152,_ZN5uking2ui16PauseMenuDataMgr17removeGrabbedItemEPN4ksys3act12BaseProcLinkE
|
||||
0x0000007100971d6c,O,001152,_ZN5uking2ui16PauseMenuDataMgr17removeGrabbedItemEPN4ksys3act12BaseProcLinkE
|
||||
0x00000071009721ec,O,000392,_ZNK5uking2ui16PauseMenuDataMgr20getEquippedArrowTypeEPN4sead22BufferedSafeStringBaseIcEEPi
|
||||
0x0000007100972374,O,000356,_ZNK5uking2ui16PauseMenuDataMgr13getArrowCountERKN4sead14SafeStringBaseIcEE
|
||||
0x00000071009724d8,O,000304,_ZNK5uking2ui16PauseMenuDataMgr17getRealArrowCountERKN4sead14SafeStringBaseIcEE
|
||||
|
|
Can't render this file because it is too large.
|
|
@ -1338,44 +1338,42 @@ void PauseMenuDataMgr::removeGrabbedItems() {
|
|||
saveToGameData(items);
|
||||
}
|
||||
|
||||
// NON_MATCHING: mostly branching (which leads to other differences), but visibly equivalent
|
||||
bool PauseMenuDataMgr::removeGrabbedItem(ksys::act::BaseProcLink* link) {
|
||||
if (!link || !link->hasProc())
|
||||
return false;
|
||||
|
||||
ksys::act::ActorConstDataAccess accessor;
|
||||
ksys::act::acquireActor(link, &accessor);
|
||||
const auto name = accessor.getName();
|
||||
auto& cs = mCritSection;
|
||||
const auto& items = getItems();
|
||||
bool found = false;
|
||||
if (link && link->hasProc()) {
|
||||
ksys::act::ActorConstDataAccess accessor;
|
||||
ksys::act::acquireActor(link, &accessor);
|
||||
const auto name = accessor.getName();
|
||||
auto& cs = mCritSection;
|
||||
const auto& items = getItems();
|
||||
|
||||
for (s32 i = 0; i < NumGrabbableItems; ++i) {
|
||||
auto& entry = mGrabbedItems[i];
|
||||
if (found) {
|
||||
mGrabbedItems[i - 1].item = entry.item;
|
||||
mGrabbedItems[i - 1]._8 = entry._8;
|
||||
mGrabbedItems[i - 1]._9 = entry._9;
|
||||
continue;
|
||||
for (s32 i = 0; i < NumGrabbableItems; ++i) {
|
||||
auto& entry = mGrabbedItems[i];
|
||||
if (found) {
|
||||
mGrabbedItems[i - 1].item = entry.item;
|
||||
mGrabbedItems[i - 1]._8 = entry._8;
|
||||
mGrabbedItems[i - 1]._9 = entry._9;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!entry.item || name != entry.item->getName())
|
||||
continue;
|
||||
|
||||
if (entry.item->getValue() == 0 && !entry._9) {
|
||||
const auto lock = sead::makeScopedLock(cs);
|
||||
auto* item = entry.item;
|
||||
destroyAndRecycleItem(mItemLists, item);
|
||||
updateInventoryInfo(items);
|
||||
updateListHeads();
|
||||
saveToGameData(items);
|
||||
mLastAddedItem = nullptr;
|
||||
}
|
||||
|
||||
found = true;
|
||||
entry = {};
|
||||
}
|
||||
|
||||
if (!entry.item || name != entry.item->getName())
|
||||
continue;
|
||||
|
||||
if (entry.item->getValue() == 0 && !entry._9) {
|
||||
const auto lock = sead::makeScopedLock(cs);
|
||||
auto* item = entry.item;
|
||||
destroyAndRecycleItem(mItemLists, item);
|
||||
updateInventoryInfo(items);
|
||||
updateListHeads();
|
||||
saveToGameData(items);
|
||||
mLastAddedItem = nullptr;
|
||||
}
|
||||
|
||||
found = true;
|
||||
entry = {};
|
||||
mGrabbedItems[4] = {};
|
||||
}
|
||||
mGrabbedItems[4] = {};
|
||||
return found;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue