From a86a366726c8cab8d48ac4c15d22bcb0d31becc7 Mon Sep 17 00:00:00 2001 From: Eric Robinson Date: Fri, 20 Sep 2024 15:27:00 -0400 Subject: [PATCH] rename numPremiumItems numPremiumsItems remains a non-class variable in the store refactor PR. --- Source/items.cpp | 4 ++-- Source/loadsave.cpp | 4 ++-- Source/stores.cpp | 6 +++--- Source/stores.h | 2 +- test/fixtures/memory_map/game.txt | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/items.cpp b/Source/items.cpp index 39f4fd3b3e7..d785ac73b57 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -4397,14 +4397,14 @@ void SpawnPremium(const Player &player) { int lvl = player.getCharacterLevel(); int maxItems = gbIsHellfire ? SMITH_PREMIUM_ITEMS : 6; - if (numPremiumItems < maxItems) { + if (NumPremiumItems < maxItems) { for (int i = 0; i < maxItems; i++) { if (premiumItem[i].isEmpty()) { int plvl = premiumItemLevel + (gbIsHellfire ? premiumLvlAddHellfire[i] : premiumlvladd[i]); SpawnOnePremium(premiumItem[i], plvl, player); } } - numPremiumItems = maxItems; + NumPremiumItems = maxItems; } while (premiumItemLevel < lvl) { premiumItemLevel++; diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index 0420dfbc146..d6e557e1e63 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -2523,7 +2523,7 @@ void LoadGame(bool firstflag) memset(dLight, 0, sizeof(dLight)); } - numPremiumItems = file.NextBE(); + NumPremiumItems = file.NextBE(); premiumItemLevel = file.NextBE(); for (int i = 0; i < giNumberOfSmithPremiumItems; i++) @@ -2786,7 +2786,7 @@ void SaveGameData(SaveWriter &saveWriter) } } - file.WriteBE(numPremiumItems); + file.WriteBE(NumPremiumItems); file.WriteBE(premiumItemLevel); for (int i = 0; i < giNumberOfSmithPremiumItems; i++) diff --git a/Source/stores.cpp b/Source/stores.cpp index 315882334d4..141a118504d 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -39,7 +39,7 @@ int8_t playerItemIndexes[48]; Item playerItem[48]; Item smithItem[SMITH_ITEMS]; -int numPremiumItems; +int NumPremiumItems; int premiumItemLevel; Item premiumItem[SMITH_PREMIUM_ITEMS]; @@ -1374,7 +1374,7 @@ void SmithBuyPItem(Item &item) } premiumItem[xx].clear(); - numPremiumItems--; + NumPremiumItems--; SpawnPremium(*MyPlayer); } @@ -2112,7 +2112,7 @@ void InitStores() activeStore = TalkID::None; isTextFullSize = false; hasScrollbar = false; - numPremiumItems = 0; + NumPremiumItems = 0; premiumItemLevel = 1; for (auto &premiumitem : premiumItem) diff --git a/Source/stores.h b/Source/stores.h index 4f5ea696035..7e6f28bec56 100644 --- a/Source/stores.h +++ b/Source/stores.h @@ -61,7 +61,7 @@ extern DVL_API_FOR_TEST Item playerItem[48]; /** Items sold by Griswold */ extern Item smithItem[SMITH_ITEMS]; /** Number of premium items for sale by Griswold */ -extern int numPremiumItems; +extern int NumPremiumItems; /** Base level of current premium items sold by Griswold */ extern int premiumItemLevel; /** Premium items sold by Griswold */ diff --git a/test/fixtures/memory_map/game.txt b/test/fixtures/memory_map/game.txt index f1c98aac768..efbcd8653be 100644 --- a/test/fixtures/memory_map/game.txt +++ b/test/fixtures/memory_map/game.txt @@ -47,7 +47,7 @@ M_DL 12544 8 dLight M_DL 12544 8 dPreLight M_DL 1600 8 AutomapView M_DL 12544 8 dMissile -R 32 numPremiumItems +R 32 NumPremiumItems R 32 premiumItemLevel C_DA 6 item PremiumItems C_HF 15 item PremiumItems