From a9e99e400cb1d4a4f862069270aeecf70074f7f4 Mon Sep 17 00:00:00 2001 From: Jerom Venneker Date: Fri, 23 May 2025 18:22:50 +0200 Subject: [PATCH] Removed IS_ARCHIPELAGO defines --- soh/include/z64save.h | 2 +- soh/soh/Enhancements/randomizer/hook_handlers.cpp | 1 - soh/soh/Network/Archipelago/Archipelago.cpp | 11 +++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/soh/include/z64save.h b/soh/include/z64save.h index 84f50ded2..ffd413455 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -339,7 +339,7 @@ typedef enum { #define IS_MASTER_QUEST (gSaveContext.ship.quest.id == QUEST_MASTER) #define IS_RANDO (gSaveContext.ship.quest.id == QUEST_RANDOMIZER) #define IS_BOSS_RUSH (gSaveContext.ship.quest.id == QUEST_BOSSRUSH) -#define IS_ARCHIPELAGO (gSaveContext.ship.quest.id == QUEST_ARCHIPELAGO) +#define IS_ARCHIPELAGO (gSaveContext.ship.quest.data.archipelago.isArchipelago == 1) typedef enum { /* 0x00 */ BTN_ENABLED, diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 25f0d6a46..a9b209b7b 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -2527,7 +2527,6 @@ void RandomizerRegisterHooks() { // TODO Implement propeerly when we can read what kind of game we're playing from the save file - #define IS_ARCHIPELAGO true COND_HOOK(GameInteractor::OnArchipelagoItemRecieved, IS_ARCHIPELAGO, ArchipelagoOnRecieveItem); if (RAND_GET_OPTION(RSK_FISHSANITY) != RO_FISHSANITY_OFF) { diff --git a/soh/soh/Network/Archipelago/Archipelago.cpp b/soh/soh/Network/Archipelago/Archipelago.cpp index 8294e5542..fc8252e59 100644 --- a/soh/soh/Network/Archipelago/Archipelago.cpp +++ b/soh/soh/Network/Archipelago/Archipelago.cpp @@ -101,9 +101,12 @@ bool ArchipelagoClient::StartClient() { } void ArchipelagoClient::GameLoaded() { + // if its not an AP save, disconnect if(!IS_ARCHIPELAGO) { - // apClient->reset(); - // return; + if(apClient != nullptr) { + apClient->reset(); + } + return; } SynchItems(); @@ -345,10 +348,6 @@ void InitArchipelagoData(bool isDebug) { } } -// Implement this properly once we have some kind of indication within a save file wether the player is in a normal -// rando save or an archipelago one. -#define IS_ARCHIPELAGO true - void RegisterArchipelago() { COND_HOOK(GameInteractor::OnRandomizerItemGivenHooks, IS_ARCHIPELAGO, [](uint32_t rc) {