From: PatR Date: Fri, 27 Jan 2023 19:01:24 +0000 (-0800) Subject: shop object sanity - buried objects X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47efcd90c74c7ce1621f7c388f02d8364a28d788;p=nethack shop object sanity - buried objects This fixes the reported sanity check warning about a buried object within shop boundary staying flagged no_charge after the shopkeeper leaves the shop. Leaving the shop to pursue the hero moves unpaid items off the bill to owed-as-robbery and changes no_charge items to shop-owned but it wasn't doing the latter for buried objects. I haven't attempted to test on a level with multiple shopkeepers. If that was working correctly for unpaid items than I think it ought to work correctly for no_charge items now. I'm not sure how thoroughly the handling for unpaid items was tested though. --- diff --git a/src/shk.c b/src/shk.c index 535a9d872..1e7725938 100644 --- a/src/shk.c +++ b/src/shk.c @@ -307,7 +307,9 @@ clear_no_charge_obj( * returns. */ if (!shkp - || (otmp->where != OBJ_FLOOR && otmp->where != OBJ_CONTAINED) + || (otmp->where != OBJ_FLOOR + && otmp->where != OBJ_CONTAINED + && otmp->where != OBJ_BURIED) || !get_obj_location(otmp, &x, &y, OBJ_CONTAINED | OBJ_BURIED) || !isok(x, y) || (rno = levl[x][y].roomno) < ROOMOFFSET @@ -354,6 +356,7 @@ setpaid(register struct monst *shkp) /* clear obj->no_charge for all obj in shkp's shop */ clear_no_charge(shkp, fobj); + clear_no_charge(shkp, gl.level.buriedobjlist); while ((obj = gb.billobjs) != 0) { obj_extract_self(obj);