From d2b3a9670a515ebd66e1135ae570de6e74ced4f9 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 2 Dec 2022 15:13:57 -0800 Subject: [PATCH] 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. --- src/shk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shk.c b/src/shk.c index 6e2b053de..3ae0ca2c2 100644 --- a/src/shk.c +++ b/src/shk.c @@ -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) {