From 69ad906ba13ab67bda3ea1b09f1e3d6bf2bd4fe2 Mon Sep 17 00:00:00 2001 From: Phlex Date: Sun, 7 Jul 2024 10:57:41 -0600 Subject: [PATCH 1/2] Fix swamp spider house having an invalid token. --- code/source/rnd/item_override.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/code/source/rnd/item_override.cpp b/code/source/rnd/item_override.cpp index 6596307..e500eea 100644 --- a/code/source/rnd/item_override.cpp +++ b/code/source/rnd/item_override.cpp @@ -679,13 +679,12 @@ 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); @@ -1046,7 +1045,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()); From ed10f579675b6632a44292faf782aee24c140ff0 Mon Sep 17 00:00:00 2001 From: Phlex Date: Sun, 7 Jul 2024 11:08:03 -0600 Subject: [PATCH 2/2] Update gold skulltula actor check in key override. --- code/include/game/actor.h | 2 ++ code/source/rnd/item_override.cpp | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/code/include/game/actor.h b/code/include/game/actor.h index 409c975..c5affc3 100644 --- a/code/include/game/actor.h +++ b/code/include/game/actor.h @@ -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) diff --git a/code/source/rnd/item_override.cpp b/code/source/rnd/item_override.cpp index e500eea..42f4adc 100644 --- a/code/source/rnd/item_override.cpp +++ b/code/source/rnd/item_override.cpp @@ -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 @@ -681,10 +681,11 @@ namespace rnd { s32 incomingNegative = incomingGetItemId < 0; 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 + // #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);