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

Fix swamp spider house having an invalid token. #78

Merged
merged 2 commits into from
Jul 7, 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
2 changes: 2 additions & 0 deletions code/include/game/actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ namespace game::act {
EnJs = 0x0085,
// Cursed Man Spider House
EnSsh = 0x0090,
// Gold Skullutla
EnSi = 0x0099,
// Powder Keg Trial Goron
EnGo = 0x00D5,
// [1] Deku Palace / Woodfall Temple moving platforms (after player lands on them)
Expand Down
16 changes: 8 additions & 8 deletions code/source/rnd/item_override.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ namespace rnd {
retKey.scene = scene;
retKey.type = ItemOverride_Type::OVR_COLLECTABLE;
retKey.flag = actor->overlay_info->info->flags;
} else if (actor->id == (game::act::Id)game::ItemId::GoldSkulltula) { // Gold Skulltula Token
retKey.scene = (actor->params >> 8) & 0x1F;
} else if (actor->id == game::act::Id::EnSi) { // Gold Skulltula Token
retKey.scene = scene;
retKey.type = ItemOverride_Type::OVR_SKULL;
retKey.flag = actor->params & 0xFF;
} else if (scene == 0x14C0 && actor->id == (game::act::Id)0x0075) { // Grotto Salesman
Expand Down Expand Up @@ -679,13 +679,13 @@ namespace rnd {
s16 incomingGetItemId) {
ItemOverride override = {0};
s32 incomingNegative = incomingGetItemId < 0;
// #if defined ENABLE_DEBUG || DEBUG_PRINT
// util::Print("%s: Our actor ID is %#06x\nScene is %#04x\nIncoming item id is %#04x\n", __func__,
// fromActor->id,
// gctx->scene, incomingGetItemId);
// #endif
if (fromActor != NULL && incomingGetItemId != 0) {
s16 getItemId = ItemOverride_CheckNpc(fromActor->id, incomingGetItemId, incomingNegative);
// #if defined ENABLE_DEBUG || DEBUG_PRINT
// util::Print("%s: Our actor ID is %#06x\nScene is %#04x\nIncoming item id is %#04x\ngetItemId
// %#04x\nParams %#04x\n", __func__, fromActor->id,
// gctx->scene, incomingGetItemId, getItemId, fromActor->params);
// #endif
storedActorId = fromActor->id;
storedGetItemId = incomingNegative ? (GetItemID)-incomingGetItemId : (GetItemID)incomingGetItemId;
override = ItemOverride_Lookup(fromActor, (u16)gctx->scene, getItemId);
Expand Down Expand Up @@ -1046,7 +1046,7 @@ namespace rnd {
}

u8 ItemOverride_OverrideSkullToken(game::GlobalContext* gctx, game::act::Actor* actor) {
s16 getItemId = gctx->scene == game::SceneId::SwampSpiderHouse ? 0x52 : 0x6D;
s16 getItemId = gctx->scene == game::SceneId::SwampSpiderHouse ? 0x44 : 0x6D;
ItemOverride_GetItem(gctx, actor, gctx->GetPlayerActor(), getItemId);
if (rActiveItemRow != NULL) {
ItemOverride_GetItemTextAndItemID(gctx->GetPlayerActor());
Expand Down
Loading