Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.5] Clear unique item flags in LoadGameLevel() #7517

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading