diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 7165222b4..5adf3188e 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -900,6 +900,9 @@ misaligned potion colors due to lack of reset_glyphmap() following obj shuffle; closed doors were described as "horizontal closed door" or "vertical closed door" instead of just "closed door" glob shrinkage while hero was away from glob's level wasn't handled properly +unpaid shop-owned glob that shrank to nothing had weight 0 which triggered + onbill warnings when 'sanity_check' was On; for 'Ix' and itemized + billing, the empty weight was shown to player if 'wizweight' was On curses: 'msg_window' option wasn't functional for curses unless the binary also included tty support diff --git a/include/obj.h b/include/obj.h index 32e30bf99..0fdd0d1ad 100644 --- a/include/obj.h +++ b/include/obj.h @@ -23,7 +23,8 @@ struct oextra { char *oname; /* ptr to name of object */ struct monst *omonst; /* ptr to attached monst struct */ char *omailcmd; /* response_cmd for mail delivery */ - unsigned omid; /* for corpse; m_id of corpse's ghost */ + unsigned omid; /* for corpse: m_id of corpse's ghost; overloaded + * for glob: owt at time added to shop's bill */ }; struct obj { diff --git a/src/shk.c b/src/shk.c index 102faafcf..1ac2a7926 100644 --- a/src/shk.c +++ b/src/shk.c @@ -946,6 +946,10 @@ obfree(register struct obj* obj, register struct obj* merge) if (!merge) { bp->useup = 1; obj->unpaid = 0; /* only for doinvbill */ + /* for used up glob, put back origial weight in case it gets + formatted ('I x' or itemized billing) with 'wizweight' On */ + if (obj->globby && !obj->owt && has_omid(obj)) + obj->owt = OMID(obj); add_to_billobjs(obj); return; } @@ -2483,9 +2487,14 @@ add_one_tobill(struct obj *obj, boolean dummy, struct monst *shkp) } else bp->useup = 0; bp->price = get_cost(obj, shkp); - if (obj->globby) + if (obj->globby) { /* for globs, the amt charged for quan 1 depends on owt */ bp->price *= get_pricing_units(obj); + /* remember the weight this glob had when it was added to bill; + glob oextra_owt field overlays corpse omid field */ + newomid(obj); + OMID(obj) = obj->owt; + } eshkp->billct++; obj->unpaid = 1; }