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 d8dde8d commit bfd289d
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 @@ -2884,6 +2884,7 @@ void LoadGameLevelFirstFlagEntry()
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 @@ -2413,6 +2413,11 @@ bool IsUniqueAvailable(int i)
return gbIsHellfire || i <= 89;
}

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

void InitItemGFX()
{
char arglist[64];
Expand All @@ -2422,7 +2427,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 @@ -487,6 +487,7 @@ extern DVL_API_FOR_TEST 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 bfd289d

Please sign in to comment.