Browse Source

Fix premium items reroll on level change

Bug introduced a few commits ago in 1519e995cf

Fixes #4036
pull/4047/head
Gleb Mazovetskiy 4 years ago committed by Anders Jenbo
parent
commit
bd5647fb06
  1. 1
      Source/diablo.cpp
  2. 5
      Source/stores.cpp
  3. 7
      Source/stores.h

1
Source/diablo.cpp

@ -1991,6 +1991,7 @@ void LoadGameLevel(bool firstflag, lvl_entry lvldir)
InitInv();
InitQuestText();
InitInfoBoxGfx();
InitStores();
InitAutomapOnce();
InitHelp();
}

5
Source/stores.cpp

@ -2279,7 +2279,7 @@ void AddStoreHoldRepair(Item *itm, int8_t i)
storenumh++;
}
void SetupTownStores()
void InitStores()
{
ClearSText(0, STORE_LINES);
stextflag = STORE_NONE;
@ -2293,7 +2293,10 @@ void SetupTownStores()
boyitem._itype = ItemType::None;
boylevel = 0;
}
void SetupTownStores()
{
auto &myPlayer = Players[MyPlayerId];
int l = myPlayer._pLevel / 2;

7
Source/stores.h

@ -101,8 +101,15 @@ extern int boylevel;
extern Item boyitem;
void AddStoreHoldRepair(Item *itm, int8_t i);
/** Clears premium items sold by Griswold and Wirt. */
void InitStores();
/** Spawns items sold by vendors, including premium items sold by Griswold and Wirt. */
void SetupTownStores();
void FreeStoreMem();
void PrintSString(const Surface &out, int margin, int line, const char *text, UiFlags flags, int price = 0);
void DrawSLine(const Surface &out, int sy);
void DrawSTextHelp();

Loading…
Cancel
Save