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

Include postbox check. #9

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion code/include/rnd/savefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ namespace rnd {
BitField<21, 1, u32> enHsGivenItem;
BitField<22, 1, u32> enMaYtoGivenItem;
BitField<23, 1, u32> enOskGivenItem;
BitField<24, 8, u32> unused;
BitField<24, 1, u32> enPstGivenItem;
BitField<25, 7, u32> unused;
};
GivenItemRegister givenItemChecks;
union FairyCollectRegister {
Expand Down
15 changes: 6 additions & 9 deletions code/source/rnd/item_override.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,24 +401,22 @@ namespace rnd {
getItemId = incomingNegative ? -0xBA : 0xBA;
}
} else if (actorId == game::act::Id::EnPst) {
getItemId = incomingNegative ? -0xBA : 0xBA;
if (gExtSaveData.givenItemChecks.enPstGivenItem == 0)
getItemId = incomingNegative ? -0xBA : 0xBA;
else
getItemId = 0x01;
} else if (actorId == game::act::Id::EnDns) {
// Business scrub salesmen in grotto.
// Same scene as gossips so need to set item manually.
getItemId = incomingNegative ? -0x01 : 0x01;
} else if (getItemId == static_cast<s16>(rnd::GetItemID::GI_MASK_CAPTAINS_HAT)) {
gExtSaveData.givenItemChecks.enOskGivenItem = 1;
} else if (storedActorId == game::act::Id::EnPst) {
getItemId = incomingNegative ? -0xBA : 0xBA;
}

return getItemId;
}

void SetExtData() {
#if defined ENABLE_DEBUG || defined DEBUG_PRINT
rnd::util::Print("%s: Settomg extdata for actor %#04x\n", __func__, storedActorId);
#endif
if (storedActorId == game::act::Id::NpcEnNb) {
gExtSaveData.givenItemChecks.enNbGivenItem = 1;
} else if (storedActorId == game::act::Id::NpcInvisibleGuard) {
Expand All @@ -430,9 +428,6 @@ namespace rnd {
} else if (storedActorId == game::act::Id::NpcEnYb) {
gExtSaveData.givenItemChecks.enYbGivenItem = 1;
} else if (storedActorId == game::act::Id::NpcEnBaba) {
#if defined ENABLE_DEBUG || defined DEBUG_PRINT
rnd::util::Print("%s: GAVE EN BABA A TALKING TO, NO MORE ITEMS.\n", __func__);
#endif
gExtSaveData.givenItemChecks.enBabaGivenItem = 1;
} else if (storedActorId == game::act::Id::NpcEnFsn) {
gExtSaveData.givenItemChecks.enFsnGivenItem = 1;
Expand All @@ -452,6 +447,8 @@ namespace rnd {
gExtSaveData.givenItemChecks.enHgoGivenItem = 1;
} else if (storedActorId == game::act::Id::EnTru) {
gExtSaveData.givenItemChecks.enTruGivenItem = 1;
} else if (storedActorId == game::act::Id::EnPst) {
gExtSaveData.givenItemChecks.enPstGivenItem = 1;
}
}

Expand Down