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.
This commit is contained in:
Tung Nguyen
2016-03-09 14:55:02 +11:00
parent 6e8da58cd0
commit 8ccdea6d8d

View File

@@ -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);