From: nethack.allison Date: Tue, 8 Jan 2002 04:42:29 +0000 (+0000) Subject: auto credit X-Git-Tag: MOVE2GIT~3530 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17f15477e1edab630bdc163b41b11cc3665e950a;p=nethack auto credit Yes, you were right. There is a reason to have a separate auto_credit flag. --- diff --git a/src/shk.c b/src/shk.c index d442bf0b3..ff64a11fb 100644 --- a/src/shk.c +++ b/src/shk.c @@ -2459,6 +2459,9 @@ register boolean peaceful, silent; /* auto-response flag for/from "sell foo?" 'a' => 'y', 'q' => 'n' */ static char sell_response = 'a'; static int sell_how = SELL_NORMAL; +/* can't just use sell_response='y' for auto_credit because the 'a' response + shouldn't carry over from ordinary selling to credit selling */ +static boolean auto_credit = FALSE; void sellobj_state(deliberate) @@ -2472,6 +2475,7 @@ int deliberate; */ sell_response = (deliberate != SELL_NORMAL) ? '\0' : 'a'; sell_how = deliberate; + auto_credit = FALSE; } void @@ -2622,7 +2626,7 @@ move_on: char c, qbuf[BUFSZ]; long tmpcr = ((offer * 9L) / 10L) + (offer <= 1L); - if (sell_how == SELL_NORMAL || sell_response == 'y') { + if (sell_how == SELL_NORMAL || auto_credit) { c = sell_response = 'y'; } else if (sell_response != 'n') { pline("%s cannot pay you at present.", Monnam(shkp)); @@ -2635,7 +2639,7 @@ move_on: c = ynaq(qbuf); if (c == 'a') { c = 'y'; - sell_response = 'y'; + auto_credit = TRUE; } } else /* previously specified "quit" */ c = 'n';