From: Tung Nguyen Date: Wed, 9 Mar 2016 03:55:02 +0000 (+1100) Subject: Credit/debit gold in containers even in sellobj_state SELL_DONTSELL X-Git-Tag: NetHack-3.6.1_RC01~830^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ccdea6d8dade3a792c3a90a12f0f8f6a63856a3;p=nethack Credit/debit gold in containers even in sellobj_state SELL_DONTSELL There's no capacity for the shop logic to handle gold without also changing the credit/debit within it, so gold must always be handled in `sellobj()`, even when the state of it is set to `SELL_DONTSELL`. This is needed for an upcoming bug fix. Based on DynaHack commit b0784c5 (Credit/debit gold in containers even in sellobj_state SELL_DONTSELL) by me. --- diff --git a/src/shk.c b/src/shk.c index 0699d36e3..5d3117563 100644 --- a/src/shk.c +++ b/src/shk.c @@ -2880,7 +2880,8 @@ xchar x, y; offer = ltmp + cltmp; /* get one case out of the way: nothing to sell, and no gold */ - if (!isgold && ((offer + gltmp) == 0L || sell_how == SELL_DONTSELL)) { + if (!(isgold || cgold) + && ((offer + gltmp) == 0L || sell_how == SELL_DONTSELL)) { boolean unpaid = is_unpaid(obj); if (container) { @@ -2956,7 +2957,7 @@ xchar x, y; currency(eshkp->credit)); } - if (!offer) { + if (!offer || sell_how == SELL_DONTSELL) { if (!isgold) { if (container) dropped_container(obj, shkp, FALSE);