unpaid object: sanity check, teleporting, 'I u'

It turns out that there are some objects marked unpaid that aren't
carried by the hero, so the recent sanity check for unpaid/no_charge
could complain.  Unpaid items dropped on the shop boundary (gap in
shop wall, doorway, shk's free spot) stayed unpaid when dropped onto
the floor, similar to recent change for pushed shop-owned boulders.
Don't give sanity complaints for those.  They could be all the way
inside a shop too, where unpaid items in a gap in the shop wall got
pushed into the shop when the wall was repaired.  (Possibly those
should come off the bill instead of remaining unpaid.)

Teleporting items out of a shop was marking them unpaid instead of
treating that as robbery.  That's a bug caught by the sanity check.
rloco() was also marking shop items which got teleported from one
spot inside the shop to another spot inside the same shop as unpaid.
Fix both of those things.  Also, if an unpaid item on the boundary
gets teleported all the way inside, take it off the bill.

Change 'I u' to mention whether there are additional unpaid items on
the floor somewhere since they won't be part of unpaid inventory and
they're not on the used-up bill either.  It might occasionally help
the player figure out why the shopkeeper won't let the hero out of
the shop.
This commit is contained in:
PatR
2022-11-29 13:55:42 -08:00
parent 8836b32128
commit e64ed2859d
6 changed files with 84 additions and 27 deletions

View File

@@ -87,8 +87,10 @@ struct obj {
Bitfield(cursed, 1); /* uncursed when neither cursed nor blessed */
Bitfield(blessed, 1);
Bitfield(unpaid, 1); /* owned by shop; valid for objects in hero's
* inventory or inside containers there;
* not used for items on the floor */
* inventory or inside containers there; also,
* used for items on the floor only on the shop
* boundary (including "free spot") or if moved
* from there to inside by wall repairs */
Bitfield(no_charge, 1); /* if shk shouldn't charge for this; valid for
* items on shop floor or in containers there;
* implicit for items at any other location