Skip to content

Commit

Permalink
Clear unique item flags in LoadGameLevel()
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCWills authored and AJenbo committed Nov 9, 2024
1 parent 78ce916 commit cce04b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Source/diablo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2713,6 +2713,7 @@ void LoadGameLevel(bool firstflag, lvl_entry lvldir)
qtextflag = false;
if (!HeadlessMode) {
InitInv();
ClearUniqueItemFlags();
InitQuestText();
InitInfoBoxGfx();
InitHelp();
Expand Down
6 changes: 5 additions & 1 deletion Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2479,6 +2479,11 @@ bool IsUniqueAvailable(int i)
return gbIsHellfire || i <= 89;
}

void ClearUniqueItemFlags()
{
memset(UniqueItemFlags, 0, sizeof(UniqueItemFlags));
}

void InitItemGFX()
{
char arglist[64];
Expand All @@ -2488,7 +2493,6 @@ void InitItemGFX()
*BufCopy(arglist, "items\\", ItemDropNames[i]) = '\0';
itemanims[i] = LoadCel(arglist, ItemAnimWidth);
}
memset(UniqueItemFlags, 0, sizeof(UniqueItemFlags));
}

void InitItems()
Expand Down
1 change: 1 addition & 0 deletions Source/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cce04b5

Please sign in to comment.