Permit gold to be included in justpicked typeinv

Just-picked-up gold was included in the list of items in the just-picked
category for most category-based menus like 'D' or #loot, but special
handling of gold for 'I'/#inventtype (to accomodate the 'goldX' option)
caused it to be excluded from consideration as a just-picked item.
Include recently picked up gold in 'P'/justpicked when doing type
inventory, consist with other category-menu-based actions.
This commit is contained in:
Michael Meyer
2022-07-03 16:52:06 -07:00
committed by PatR
parent 59b9a684ac
commit 7a008b62b7
+5 -6
View File
@@ -3632,6 +3632,8 @@ tally_BUCX(struct obj *list, boolean by_nexthere,
/* priests always know bless/curse state */ /* priests always know bless/curse state */
if (Role_if(PM_CLERIC)) if (Role_if(PM_CLERIC))
list->bknown = (list->oclass != COIN_CLASS); list->bknown = (list->oclass != COIN_CLASS);
if (list->pickup_prev)
++(*jcp);
/* coins are either uncursed or unknown based upon option setting */ /* coins are either uncursed or unknown based upon option setting */
if (list->oclass == COIN_CLASS) { if (list->oclass == COIN_CLASS) {
if (flags.goldX) if (flags.goldX)
@@ -3640,8 +3642,6 @@ tally_BUCX(struct obj *list, boolean by_nexthere,
++(*ucp); ++(*ucp);
continue; continue;
} }
if (list->pickup_prev)
++(*jcp);
/* ordinary items */ /* ordinary items */
if (!list->bknown) if (!list->bknown)
++(*xcp); ++(*xcp);
@@ -3795,7 +3795,9 @@ this_type_only(struct obj *obj)
{ {
boolean res = (obj->oclass == g.this_type); boolean res = (obj->oclass == g.this_type);
if (obj->oclass == COIN_CLASS) { if (g.this_type == 'P') {
res = obj->pickup_prev;
} else if (obj->oclass == COIN_CLASS) {
/* if filtering by bless/curse state, gold is classified as /* if filtering by bless/curse state, gold is classified as
either unknown or uncursed based on user option setting */ either unknown or uncursed based on user option setting */
if (g.this_type && index("BUCX", g.this_type)) if (g.this_type && index("BUCX", g.this_type))
@@ -3814,9 +3816,6 @@ this_type_only(struct obj *obj)
case 'X': case 'X':
res = !obj->bknown; res = !obj->bknown;
break; break;
case 'P':
res = obj->pickup_prev;
break;
default: default:
break; /* use 'res' as-is */ break; /* use 'res' as-is */
} }