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
This commit is contained in:
Christopher Leggett 2022-08-11 21:24:03 -04:00
parent 4b7548e998
commit e1084c0d6d
No known key found for this signature in database
GPG Key ID: 7093AE5FF7037D79
2 changed files with 2 additions and 4 deletions

View File

@ -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]);
}

View File

@ -7,8 +7,6 @@
#include <memory>
#include <soh/Enhancements/randomizer/randomizerTypes.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
class Randomizer {
private:
std::unordered_map<RandomizerCheck, RandomizerGet> itemLocations;