Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust powder keg item check to ensure it stays in inventory. #26

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions code/source/rnd/item_override.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ namespace rnd {
rItemOverrides[0].value.looksLikeItemId = 0x26;
rItemOverrides[1].key.scene = 0x6F;
rItemOverrides[1].key.type = ItemOverride_Type::OVR_COLLECTABLE;
rItemOverrides[1].value.getItemId = 0x76;
rItemOverrides[1].value.looksLikeItemId = 0x76;
rItemOverrides[1].value.getItemId = 0x34;
rItemOverrides[1].value.looksLikeItemId = 0x34;
rItemOverrides[2].key.scene = 0x12;
rItemOverrides[2].key.type = ItemOverride_Type::OVR_COLLECTABLE;
rItemOverrides[2].value.getItemId = 0x37;
Expand Down Expand Up @@ -655,10 +655,11 @@ namespace rnd {
s16 incomingGetItemId) {
ItemOverride override = {0};
s32 incomingNegative = incomingGetItemId < 0;
// #if defined ENABLE_DEBUG || DEBUG_PRINT
// rnd::util::Print("%s: Our actor ID is %#06x\nScene is %#04x\nIncoming item id is %#04x", __func__,
// fromActor->id, gctx->scene, incomingGetItemId);
// #endif
if (fromActor != NULL && incomingGetItemId != 0) {
// #if defined ENABLE_DEBUG || DEBUG_PRINT
// rnd::util::Print("%s: Our actor ID is %#06x\n", __func__, fromActor->id);
// #endif
s16 getItemId = ItemOverride_CheckNpc(fromActor->id, incomingGetItemId, incomingNegative);
storedActorId = fromActor->id;
storedGetItemId = (rnd::GetItemID)incomingGetItemId;
Expand Down Expand Up @@ -887,13 +888,14 @@ namespace rnd {
// Check scene if we want to buy from goron.
auto* gctx = rnd::GetContext().gctx;

if (gctx->scene == game::SceneId::BombShop) {
return game::HasItem((game::ItemId)currentItem) ? (int) currentItem
: (int)0xFF;
if (gctx->scene == game::SceneId::GoronVillageWinter || gctx->scene == game::SceneId::GoronVillageSpring) {
return givenItems.enGoGivenItem ? (int) currentItem
: (int)0xFF;

}

return givenItems.enGoGivenItem ? (int) currentItem
: (int)0xFF;
return game::HasItem((game::ItemId)currentItem) ? (int) currentItem
: (int)0xFF;
} else if (currentItem == game::ItemId::GiantMask) {
return givenItems.enBoss02GivenItem ? (int) currentItem
: (int)0xFF;
Expand Down
Loading