From cce04b55ac952db6a344aca26344608ea8a1896c Mon Sep 17 00:00:00 2001 From: staphen Date: Sat, 9 Nov 2024 12:12:23 -0500 Subject: [PATCH] Clear unique item flags in LoadGameLevel() --- Source/diablo.cpp | 1 + Source/items.cpp | 6 +++++- Source/items.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index fa96870e37d..18e61e69efb 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -2713,6 +2713,7 @@ void LoadGameLevel(bool firstflag, lvl_entry lvldir) qtextflag = false; if (!HeadlessMode) { InitInv(); + ClearUniqueItemFlags(); InitQuestText(); InitInfoBoxGfx(); InitHelp(); diff --git a/Source/items.cpp b/Source/items.cpp index 86e02f4d614..db68ad250c4 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -2479,6 +2479,11 @@ bool IsUniqueAvailable(int i) return gbIsHellfire || i <= 89; } +void ClearUniqueItemFlags() +{ + memset(UniqueItemFlags, 0, sizeof(UniqueItemFlags)); +} + void InitItemGFX() { char arglist[64]; @@ -2488,7 +2493,6 @@ void InitItemGFX() *BufCopy(arglist, "items\\", ItemDropNames[i]) = '\0'; itemanims[i] = LoadCel(arglist, ItemAnimWidth); } - memset(UniqueItemFlags, 0, sizeof(UniqueItemFlags)); } void InitItems() diff --git a/Source/items.h b/Source/items.h index 5e862bfbf84..750e9e1d44a 100644 --- a/Source/items.h +++ b/Source/items.h @@ -483,6 +483,7 @@ extern bool UniqueItemFlags[128]; uint8_t GetOutlineColor(const Item &item, bool checkReq); bool IsItemAvailable(int i); bool IsUniqueAvailable(int i); +void ClearUniqueItemFlags(); void InitItemGFX(); void InitItems(); void CalcPlrItemVals(Player &player, bool Loadgfx);