From e1084c0d6da6019f2cc29c57c8927dfb2b07e405 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Thu, 11 Aug 2022 21:24:03 -0400 Subject: [PATCH] Removes ARRAY_SIZE in favor of ARRAY_COUNT ARRAY_COUNT already exists in `macros.h`, I just didn't find it before. Addresses https://github.com/HarbourMasters/Shipwright/pull/1050#discussion_r943153833 --- soh/soh/Enhancements/randomizer/randomizer.cpp | 4 ++-- soh/soh/Enhancements/randomizer/randomizer.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 9a8cebae3..3e4827378 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -4641,7 +4641,7 @@ void InitRandoItemTable() { GET_ITEM(RG_BOTTLE_WITH_BIG_POE, OBJECT_GI_GHOST, GID_BIG_POE, 0xF9, 0x80, CHEST_ANIM_LONG), }; ItemTableManager::Instance->AddItemTable(MOD_RANDOMIZER); - for (int i = 0; i < ARRAY_SIZE(extendedVanillaGetItemTable); i++) { + for (int i = 0; i < ARRAY_COUNT(extendedVanillaGetItemTable); i++) { extendedVanillaGetItemTable[i].modIndex = MOD_NONE; // These items should use their RG value as their getItemID. // RANDOTODO: Add the getItemID as a member of the GetItemEntry @@ -4719,7 +4719,7 @@ void InitRandoItemTable() { } ItemTableManager::Instance->AddItemEntry(MOD_RANDOMIZER, getItemID, extendedVanillaGetItemTable[i]); } - for (int i = 0; i < ARRAY_SIZE(randoGetItemTable); i++) { + for (int i = 0; i < ARRAY_COUNT(randoGetItemTable); i++) { randoGetItemTable[i].modIndex = MOD_RANDOMIZER; ItemTableManager::Instance->AddItemEntry(MOD_RANDOMIZER, randoGetItemTable[i].itemId, randoGetItemTable[i]); } diff --git a/soh/soh/Enhancements/randomizer/randomizer.h b/soh/soh/Enhancements/randomizer/randomizer.h index 38b8c11fd..fac9ba93c 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.h +++ b/soh/soh/Enhancements/randomizer/randomizer.h @@ -7,8 +7,6 @@ #include #include -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - class Randomizer { private: std::unordered_map itemLocations;