From 8ccdea6d8dade3a792c3a90a12f0f8f6a63856a3 Mon Sep 17 00:00:00 2001 From: Tung Nguyen Date: Wed, 9 Mar 2016 14:55:02 +1100 Subject: [PATCH] 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. --- src/shk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.50.1