Browse Source

🐛 Correct requirement line in stores

Fixes #1167
pull/547/head
Anders Jenbo 5 years ago
parent
commit
14074608be
  1. 2
      Source/items.cpp
  2. 17
      Source/stores.cpp

2
Source/items.cpp

@ -4093,7 +4093,7 @@ static void PrintItemInfo(ItemStruct *x)
Uint8 str = x->_iMinStr;
Uint8 dex = x->_iMinDex;
Uint8 mag = x->_iMinMag;
if (str || mag || dex) {
if (str != 0 || mag != 0 || dex != 0) {
strcpy(tempstr, "Required:");
if (str)
sprintf(tempstr + strlen(tempstr), " %i Str", str);

17
Source/stores.cpp

@ -170,17 +170,18 @@ void PrintStoreItem(ItemStruct *x, int l, char iclr)
if (x->_itype == ITYPE_MISC)
sstr[0] = '\0';
str = x->_iMinStr;
dex = x->_iMinDex;
mag = x->_iMinMag;
if ((str + mag + dex) == 0) {
dex = x->_iMinDex;
if (str == 0 && mag == 0 && dex == 0) {
strcat(sstr, "No required attributes");
} else {
if (x->_iMinStr)
sprintf(tempstr, "Required: %i Str", x->_iMinStr);
if (x->_iMinMag)
sprintf(tempstr, "Required: %i Mag", x->_iMinMag);
if (x->_iMinDex)
sprintf(tempstr, "Required: %i Dex", x->_iMinDex);
strcpy(tempstr, "Required:");
if (str)
sprintf(tempstr + strlen(tempstr), " %i Str", str);
if (mag)
sprintf(tempstr + strlen(tempstr), " %i Mag", mag);
if (dex)
sprintf(tempstr + strlen(tempstr), " %i Dex", dex);
strcat(sstr, tempstr);
}
AddSText(40, l++, FALSE, sstr, iclr, FALSE);

Loading…
Cancel
Save