diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 9d95bb0bc..b47c86622 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1642,12 +1642,16 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { } else if ((item >= ITEM_SWORD_KOKIRI) && (item <= ITEM_SWORD_BGS)) { gSaveContext.inventory.equipment |= gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD]; + // Both Giant's Knife and Biggoron Sword have the same Item ID, so this part handles both of them if (item == ITEM_SWORD_BGS) { gSaveContext.swordHealth = 8; - if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF - ||(gSaveContext.n64ddFlag && ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xE)) { // In rando, when buying Giant's Knife, also check - gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; // for 0xE in case we don't have Kokiri Sword + // In rando, when buying Giant's Knife, also check + // for 0xE in case we don't have Kokiri Sword + if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF || (gSaveContext.n64ddFlag && ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xE)) { + + gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; + if (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) { gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; Interface_LoadItemIcon1(globalCtx, 0); diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index aa07c1450..39e1195f5 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -205,13 +205,13 @@ void Randomizer_UpdateSkullReward(EnSi* this, GlobalContext* globalCtx) { getItem = Randomizer_GetRandomizedItem(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum); getItemId = getItem.getItemId; if (getItemId == RG_ICE_TRAP) { - player->getItemEntry = getItem; player->pendingIceTrap = true; textId = 0xF8; } else { textId = getItem.textId; giveItemId = getItem.itemId; } + player->getItemEntry = getItem; } void Randomizer_GiveSkullReward(EnSi* this, GlobalContext* globalCtx) { @@ -222,5 +222,8 @@ void Randomizer_GiveSkullReward(EnSi* this, GlobalContext* globalCtx) { } else if (getItem.modIndex == MOD_RANDOMIZER) { Randomizer_Item_Give(globalCtx, getItem); } - player->getItemEntry = getItem; + // RANDOTOD: Move this into Item_Give() or some other more central location + if (getItem.getItemId == GI_SWORD_BGS) { + gSaveContext.bgsFlag = true; + } }