obj->no_charge insanity

An object in a shop that was marked no_charge and got removed from
the shop by means other than the hero picking it up (test case
teleported it out while hero was inside shop) was left with the
no_charge bit set.  It's supposed to only be set for objects inside
shops so was triggering the recently added no_charge sanity checks.

Changing stolen_value() to have it pass the reset_nocharge arg to
billable() solves this but could have unanticipated results with
other stealing from shops.
This commit is contained in:
PatR
2022-12-02 15:13:57 -08:00
parent 345c2e1cb6
commit d2b3a9670a

View File

@@ -2975,7 +2975,7 @@ stolen_value(
u_count = count_contents(obj, TRUE, FALSE, FALSE, FALSE);
}
if (!billable(&shkp, obj, roomno, FALSE)) {
if (!billable(&shkp, obj, roomno, TRUE)) {
/* things already on the bill yield a not-billable result, so
we need to check bill before deciding that shk doesn't care */
if ((bp = onbill(obj, shkp, FALSE)) != 0) {