diff --git a/Source/items.cpp b/Source/items.cpp index 281b69340..867fe9c60 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -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(); diff --git a/Source/stores.cpp b/Source/stores.cpp index 8a65d75f8..d61853247 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -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; @@ -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]; diff --git a/Source/stores.h b/Source/stores.h index 278968dea..750b4e629 100644 --- a/Source/stores.h +++ b/Source/stores.h @@ -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; diff --git a/defs.h b/defs.h index 4febefb13..1feb10d32 100644 --- a/defs.h +++ b/defs.h @@ -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