From 589c6675fe419901782b43527bfcb11fb5808352 Mon Sep 17 00:00:00 2001 From: CraftyBoss Date: Thu, 2 Jul 2026 00:50:07 -0700 Subject: [PATCH] fix inventory reset ignoring previously obtained items on inv fill, add heros clothes to reset inventory default --- src/dusk/archipelago/archipelago_context.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/dusk/archipelago/archipelago_context.cpp b/src/dusk/archipelago/archipelago_context.cpp index 6792b56da7..e5c3a164ed 100644 --- a/src/dusk/archipelago/archipelago_context.cpp +++ b/src/dusk/archipelago/archipelago_context.cpp @@ -239,7 +239,7 @@ void ArchipelagoContext::LoadTempLocationInfo() { void ArchipelagoContext::itemRecvImpl(int id, bool notify) { if (!m_apItemToGameItem.contains(id)) { - DuskLog.warn("Got an invalid Item Id: {}", id); + DuskLog.warn("[AP] Got an invalid Item Id: {}", id); return; } @@ -345,6 +345,9 @@ const std::string& ArchipelagoContext::GetPassword(int file) { std::string ArchipelagoContext::GetArchipelagoSeedName() { if (IsConnected()) { auto& roomInfo = instance().m_roomInfo; + if (roomInfo.seed_name.empty()) { + DuskLog.warn("Got an invalid Seed Name!"); + } return fmt::format("AP_{}", roomInfo.seed_name); }else { DuskLog.fatal("Archipelago was not connected when attempting to get seed name!"); @@ -506,12 +509,13 @@ void ArchipelagoContext::Execute() { void ArchipelagoContext::HandleItemReceived(AP_NetworkItem& netItem, bool notify) { int relativeId = netItem.item - ARCHI_ITEM_OFFSET; + // TODO: modify this to also include junk items like ammo if (!notify && ((relativeId >= 0 && relativeId <= 6) || relativeId == 7)) { // skip rupee refills so players cant abuse disconnect/reconnect return; } - if (netItem.location != -1 && IsLocationChecked(netItem.location)) { + if (!instance().m_isNeedResetInv && netItem.location != -1 && IsLocationChecked(netItem.location)) { // no need to handle item if its location has already been checked return; } @@ -538,6 +542,10 @@ void ArchipelagoContext::HandleResetInventory() { playerInfo.getPlayerStatusA().setWalletSize(WALLET); // dont reset rupees, and instead reject rupee updates while refilling inv + // add back default items + + execItemGet(dItemNo_WEAR_KOKIRI_e); + // sync all location collect flags with current collection status obtained from initial room connection UpdateAllLocationState(); @@ -706,6 +714,7 @@ void ArchipelagoContext::UpdateLocationState(int locId, bool collected) { void ArchipelagoContext::UpdateAllLocationState() { auto& world = instance().m_archiWorld; + // TODO: find out why some locations seem to keep their collection state upon reset (bugs) for (const auto& [locName, locInfo] : instance().m_locationItemInfo) { auto location = world->GetLocation(locInfo.locationName, true);