diff --git a/soh/soh/Enhancements/randomizer/3drando/item_list.cpp b/soh/soh/Enhancements/randomizer/3drando/item_list.cpp index 025c8805a..afc677cd4 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_list.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_list.cpp @@ -7,6 +7,8 @@ using namespace Logic; +static std::array itemTable; + void ItemTable_Init() { // RandomizerGet English name French Spanish Item Type getItemID advancement logic hint key itemTable[NONE] = Item(RG_NONE, Text{"No Item", "Rien", "Sin Objeto"}, ITEMTYPE_EVENT, GI_RUPEE_GREEN, false, &noVariable, NONE); itemTable[KOKIRI_SWORD] = Item(RG_KOKIRI_SWORD, Text{"Kokiri Sword", "Épée Kokiri", "Espada Kokiri"}, ITEMTYPE_ITEM, GI_SWORD_KOKIRI, true, &KokiriSword, KOKIRI_SWORD); @@ -287,3 +289,7 @@ void NewItem(const uint32_t itemKey, const Item item) { itemTable[itemKey] = item; } + +std::array* GetFullItemTable_() { + return &itemTable; +} \ No newline at end of file diff --git a/soh/soh/Enhancements/randomizer/3drando/item_list.hpp b/soh/soh/Enhancements/randomizer/3drando/item_list.hpp index ffd13e652..62604c9c4 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_list.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_list.hpp @@ -3,8 +3,7 @@ #include "item.hpp" #include "keys.hpp" -static std::array itemTable; - void ItemTable_Init(); Item& ItemTable(uint32_t itemKey); void NewItem(uint32_t itemKey, Item item); +std::array* GetFullItemTable_(); diff --git a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp index 43b2b5309..8262798d3 100644 --- a/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/rando_main.cpp @@ -30,5 +30,5 @@ void RandoMain::GenerateRando(std::unordered_map cvarS std::array* RandoMain::GetFullItemTable() { ItemTable_Init(); - return &itemTable; + return GetFullItemTable_(); } diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index c1f05478d..b3b87e36b 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -105,7 +105,9 @@ Randomizer::Randomizer() { } for (auto item: *RandoMain::GetFullItemTable()) { - SohImGui::GetConsole()->SendInfoMessage("GetFullItemTable %d %s", item.GetRandomizerGet(), item.GetName().english.c_str()); + // Easiest way to filter out all the empty values from the array, since we still technically want the 0/RG_NONE entry + if (item.GetName().english.empty()) continue; + SohImGui::GetConsole()->SendInfoMessage("GetFullItemTable %d %s %d", item.GetRandomizerGet(), item.GetName().english.c_str(), item.GetItemID()); SpoilerfileGetNameToEnum[item.GetName().english] = item.GetRandomizerGet(); SpoilerfileGetNameToEnum[item.GetName().french] = item.GetRandomizerGet(); EnumToSpoilerfileGetName[item.GetRandomizerGet()] = {