Fix broken SHOW logic for potions.

This commit is contained in:
Enno Rehling 2018-01-12 20:45:59 +01:00
parent 4d38a40e96
commit efec41ca56
1 changed files with 9 additions and 13 deletions

View File

@ -2414,26 +2414,22 @@ static void reshow_other(unit * u, struct order *ord, const char *s) {
if (itype) {
/* if this is a potion, we need the right alchemy skill */
int i = i_get(u->items, itype);
err = 36; /* we do not have this item? */
if (i <= 0 && (itype->flags & ITF_POTION)) {
if (itype->flags & ITF_POTION) {
/* we don't have the item, but it is a potion. do we know it? */
int level = potion_level(itype);
if (level > 0 && 2 * level > effskill(u, SK_ALCHEMY, 0)) {
itype = NULL;
}
}
}
if (itype) {
if (itype->flags & ITF_POTION) {
if (level > 0 && 2 * level <= effskill(u, SK_ALCHEMY, 0)) {
display_potion(u, itype);
found = true;
}
}
else {
int i = i_get(u->items, itype);
if (i > 0) {
found = true;
display_item(u, itype);
}
found = true;
}
}
if (sp) {