From 030a1d92f8f65aef766069ec7a0c393894d5fb16 Mon Sep 17 00:00:00 2001 From: xxAtrain223 Date: Sat, 12 Jul 2025 22:44:07 -0500 Subject: [PATCH] Updated location_access.cpp to only log Parse Failures. --- .../randomizer/location_access.cpp | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/location_access.cpp b/soh/soh/Enhancements/randomizer/location_access.cpp index c7af0de0a..269ca674e 100644 --- a/soh/soh/Enhancements/randomizer/location_access.cpp +++ b/soh/soh/Enhancements/randomizer/location_access.cpp @@ -14,6 +14,7 @@ #include "3drando/shops.hpp" #include +#include "logic_expression.h" extern "C" { extern PlayState* gPlayState; } @@ -914,17 +915,32 @@ void RegionTable_Init() { for (uint32_t i = RR_ROOT; i <= RR_GANONS_CASTLE; i++) { for (EventAccess& eventAccess : areaTable[i].events) { - ss << eventAccess.GetConditionStr() << std::endl; + try { + LogicExpression::Parse(eventAccess.GetConditionStr()); + } + catch (std::exception& ex) { + ss << eventAccess.GetConditionStr() << std::endl; + } } for (LocationAccess& locPair : areaTable[i].locations) { - ss << locPair.GetConditionStr() << std::endl; + try { + LogicExpression::Parse(locPair.GetConditionStr()); + } + catch (std::exception& ex) { + ss << locPair.GetConditionStr() << std::endl; + } } for (Entrance& exit : areaTable[i].exits) { - ss << exit.GetConditionStr() << std::endl; + try { + LogicExpression::Parse(exit.GetConditionStr()); + } + catch (std::exception& ex) { + ss << exit.GetConditionStr() << std::endl; + } } } - SPDLOG_INFO("All Conditions:\n{}", ss.str()); + SPDLOG_INFO("Parse Failure Conditions:\n{}", ss.str()); #endif }