diff --git a/Source/items.cpp b/Source/items.cpp index bcdffb8b9..7a3c7d15a 100644 --- a/Source/items.cpp +++ b/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); diff --git a/Source/stores.cpp b/Source/stores.cpp index 174398946..bf5975bb3 100644 --- a/Source/stores.cpp +++ b/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);