Skip to content

Commit

Permalink
[hellfire] SmithBuyItem bin exact
Browse files Browse the repository at this point in the history
  • Loading branch information
qndel authored and AJenbo committed Sep 25, 2019
1 parent e2f14a7 commit b45b33c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
6 changes: 1 addition & 5 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3780,11 +3780,7 @@ void SpawnSmith(int lvl)
smithitem[i]._iIdentified = TRUE;
smithitem[i]._iStatFlag = StoreStatOk(&smithitem[i]);
}
#ifdef HELLFIRE
for (i = iCnt; i < 25; i++)
#else
for (i = iCnt; i < 20; i++)
#endif
for (i = iCnt; i < SMITH_ITEMS; i++)
smithitem[i]._itype = ITYPE_NONE;

SortSmith();
Expand Down
10 changes: 3 additions & 7 deletions Source/stores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ int gossipend;
BYTE *pSPentSpn2Cels;
int stextsval;
int boylevel;
#ifdef HELLFIRE
ItemStruct smithitem[25];
#else
ItemStruct smithitem[20];
#endif
ItemStruct smithitem[SMITH_ITEMS];
int stextdown;
char stextscrlubtn;
char stextflag;
Expand Down Expand Up @@ -1891,8 +1887,8 @@ void SmithBuyItem()
plr[myplr].HoldItem._iIdentified = FALSE;
StoreAutoPlace();
idx = stextvhold + ((stextlhold - stextup) >> 2);
if (idx == 19) {
smithitem[19]._itype = ITYPE_NONE;
if (idx == SMITH_ITEMS-1) {
smithitem[SMITH_ITEMS-1]._itype = ITYPE_NONE;
} else {
for (; smithitem[idx + 1]._itype != ITYPE_NONE; idx++) {
smithitem[idx] = smithitem[idx + 1];
Expand Down
6 changes: 1 addition & 5 deletions Source/stores.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ extern int gossipend;
extern BYTE *pSPentSpn2Cels;
extern int stextsval;
extern int boylevel;
#ifdef HELLFIRE
extern ItemStruct smithitem[25];
#else
extern ItemStruct smithitem[20];
#endif
extern ItemStruct smithitem[SMITH_ITEMS];
extern int stextdown;
extern char stextscrlubtn;
extern char stextflag;
Expand Down
2 changes: 2 additions & 0 deletions defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@
// todo: enums
#ifdef HELLFIRE
#define NUMLEVELS 25
#define SMITH_ITEMS 25
#define SMITH_PREMIUM_ITEMS 15
#else
#define NUMLEVELS 17
#define SMITH_ITEMS 20
#define SMITH_PREMIUM_ITEMS 6
#endif

Expand Down

0 comments on commit b45b33c

Please sign in to comment.