shop feedback ("gold piecess") (trunk only)
From a bug report, dropping and selling a container that had some things owned
by the hero and some already owned by the shop, you could get "You sold
some items inside <a container> for N gold piecess." Shop handing for
containers has been changed significantly since 3.4.3, but the typo
"pieces" that then optionally gets plural "s" appended was still there.
While testing the trivial fix, I noticed suboptional feedback in the
prompt about selling. For a container owned by the shop, it said "items"
even when there was just one hero owned item inside. Fortunately this
potentinal can of worns only seemed to have one tiny weeny worm in it....
The revised version of count_buc() that I've had laying around for
a while is also included.
The fixes entry is for "piecess", not escaped/captured/exterminated
worms, and goes into fixes34.4 despite this patch being labeled "trunk
only". Separate patch for trunk to follow.
This commit is contained in:
30
src/shk.c
30
src/shk.c
@@ -2876,9 +2876,15 @@ xchar x, y;
|
||||
|
||||
if (short_funds) offer = shkmoney;
|
||||
if (!sell_response) {
|
||||
only_partially_your_contents = (container &&
|
||||
contained_cost(obj, shkp, 0L, FALSE, FALSE) !=
|
||||
contained_cost(obj, shkp, 0L, FALSE, TRUE));
|
||||
long yourc = 0L, shksc;
|
||||
|
||||
if (container) {
|
||||
/* number of items owned by shk */
|
||||
shksc = count_contents(obj, TRUE, TRUE, FALSE);
|
||||
/* number of items owned by you (total - shksc) */
|
||||
yourc = count_contents(obj, TRUE, TRUE, TRUE) - shksc;
|
||||
only_partially_your_contents = shksc && yourc;
|
||||
}
|
||||
/*
|
||||
"<shk> offers * for ..." query formatting.
|
||||
Normal item(s):
|
||||
@@ -2895,22 +2901,26 @@ xchar x, y;
|
||||
Your container:
|
||||
"... your <empty bag>. Sell it?"
|
||||
"... your <bag> and its contents. Sell them?"
|
||||
"... your <bag> and item inside. Sell them?"
|
||||
"... your <bag> and items inside. Sell them?"
|
||||
Shk's container:
|
||||
(empty case won't happen--nothing to sell)
|
||||
"... the contents of the <bag>. Sell them?"
|
||||
"... your item in the <bag>. Sell it?"
|
||||
"... your items in the <bag>. Sell them?"
|
||||
*/
|
||||
Sprintf(qbuf, "%s offers%s %ld gold piece%s for %s%s ",
|
||||
shkname(shkp), short_funds ? " only" : "",
|
||||
offer, plur(offer),
|
||||
(cltmp && !ltmp) ? (only_partially_your_contents ?
|
||||
"your items in " : the_contents_of) : "",
|
||||
(cltmp && !ltmp) ?
|
||||
((yourc == 1L) ? "your item in " :
|
||||
"your items in ") : "",
|
||||
obj->unpaid ? "the" : "your");
|
||||
one = (obj->quan == 1L && !cltmp);
|
||||
one = obj->unpaid ? (yourc == 1L) :
|
||||
(obj->quan == 1L && !cltmp);
|
||||
Sprintf(qsfx, "%s. Sell %s?",
|
||||
(cltmp && ltmp) ? (only_partially_your_contents ?
|
||||
" and items inside" : and_its_contents) : "",
|
||||
((yourc == 1L) ? " and item inside" :
|
||||
" and items inside") :
|
||||
and_its_contents) : "",
|
||||
one ? "it" : "them");
|
||||
(void)safe_qbuf(qbuf, qbuf, qsfx,
|
||||
obj, xname, simpleonames,
|
||||
@@ -2932,7 +2942,7 @@ xchar x, y;
|
||||
pay(-offer, shkp);
|
||||
shk_names_obj(shkp, obj, (sell_how != SELL_NORMAL) ?
|
||||
(!ltmp && cltmp && only_partially_your_contents) ?
|
||||
"sold some items inside %s for %ld gold pieces%s.%s" :
|
||||
"sold some items inside %s for %ld gold piece%s.%s" :
|
||||
"sold %s for %ld gold piece%s.%s" :
|
||||
"relinquish %s and receive %ld gold piece%s in compensation.%s",
|
||||
offer, "");
|
||||
|
||||
Reference in New Issue
Block a user