]> granicus.if.org Git - nethack/commitdiff
shop credit feedback (trunk only)
authornethack.rankin <nethack.rankin>
Sat, 23 Jul 2011 03:53:09 +0000 (03:53 +0000)
committernethack.rankin <nethack.rankin>
Sat, 23 Jul 2011 03:53:09 +0000 (03:53 +0000)
     Fix the first of a couple of minor things I noticed when viewing
that guy's ttyrec about a hidden inventory item which turned out to be
scrolls of scare monster on the used-up items section of his shop bill.

     Be more precise when a shopkeeper gives the hero credit for dropped
gold.  Instead of just displaying
  N zorkmids are added to your credit.
show either
  You have established N zorkmids credit.
when you had no previous credit, or
  N zorkmids added to your credit; total is now X zorkmids.
when adding to existing credit.

src/shk.c

index cc7d53d21e17d024db4094fb3aa19cbb4daad8e0..d6992b6663ca4931727eec07b8492616b830651c 100644 (file)
--- a/src/shk.c
+++ b/src/shk.c
@@ -2722,11 +2722,16 @@ xchar x, y;
                        eshkp->loan = 0L;
                        Your("debt is paid off.");
                    }
-                   pline("%ld %s %s added to your credit.",
-                               delta, currency(delta), delta > 1L ? "are" : "is");
+                   if (eshkp->credit == delta)
+                       You("have established %ld %s credit.",
+                           delta, currency(delta));
+                   else
+                       pline("%ld %s added to your credit; total is now %ld %s.",
+                             delta, currency(delta),
+                             eshkp->credit, currency(eshkp->credit));
                }
-               if(offer) goto move_on;
-               else {
+
+               if (!offer) {
                    if(!isgold) {
                        if (container)
                            dropped_container(obj, shkp, FALSE);
@@ -2736,7 +2741,7 @@ xchar x, y;
                    return;
                }
        }
-move_on:
+
        if((!saleitem && !(container && cltmp > 0L))
           || eshkp->billct == BILLSZ
           || obj->oclass == BALL_CLASS