diff --git a/doc/fixes36.1 b/doc/fixes36.1 index d33e86598..3dfa88bbb 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -568,6 +568,9 @@ try again to fix achievement recording bug with mines and sokoban prizes the fix for secret doors on special levels always having vertical orientation resulted in some--but not all--secret doors within vertical walls being displayed as horizontal walls while still hidden +the fix intended for "a shop object stolen from outside the shop (via + grappling hook) would be left marked as 'unpaid'" broke normal pickup, + preventing any picked up item from merging with compatible stack Platform- and/or Interface-Specific Fixes diff --git a/src/pickup.c b/src/pickup.c index d09bbbfdb..0f53d8cbb 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 pickup.c $NHDT-Date: 1515144225 2018/01/05 09:23:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.193 $ */ +/* NetHack 3.6 pickup.c $NHDT-Date: 1516581051 2018/01/22 00:30:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.194 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1500,17 +1500,16 @@ struct obj *otmp; boolean robshop = (!u.uswallow && otmp != uball && costly_spot(ox, oy)); obj_extract_self(otmp); - otmp->nomerge = 1; - result = addinv(otmp); - otmp->nomerge = 0; newsym(ox, oy); - /* this used to be done before addinv(), but remote_burglary() - calls rob_shop() which calls setpaid() after moving costs of - unpaid items to shop debt; setpaid() calls clear_unpaid() for - lots of object chains, but 'otmp' wasn't on any of those so - remained flagged as an unpaid item in inventory, triggering - impossible() every time inventory was examined... */ + /* for shop items, addinv() needs to be after addtobill() (so that + object merger can take otmp->unpaid into account) but before + remote_robbery() (which calls rob_shop() which calls setpaid() + after moving costs of unpaid items to shop debt; setpaid() + calls clear_unpaid() for lots of object chains, but 'otmp' isn't + on any of those between obj_extract_self() and addinv(); for + 3.6.0, 'otmp' remained flagged as an unpaid item in inventory + and triggered impossible() every time inventory was examined) */ if (robshop) { char saveushops[5], fakeshop[2]; @@ -1524,10 +1523,14 @@ struct obj *otmp; /* sets obj->unpaid if necessary */ addtobill(otmp, TRUE, FALSE, FALSE); Strcpy(u.ushops, saveushops); - /* if you're outside the shop, make shk notice */ - if (!index(u.ushops, *fakeshop)) - remote_burglary(ox, oy); + robshop = otmp->unpaid && !index(u.ushops, *fakeshop); } + + result = addinv(otmp); + /* if you're taking a shop item from outside the shop, make shk notice */ + if (robshop) + remote_burglary(ox, oy); + return result; }