diff --git a/doc/fixes36.2 b/doc/fixes36.2 index 1e8d84cb6..e7b109d05 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -278,6 +278,11 @@ while inside a shop, dropping an unpaid item inside an engulfer would leave the engulfer was killed; treat dropping shop items inside an engulfer as stealing them and giving them to that engulfer--hero must pay for for them and shop retains ownership of them +while levitating inside a shop, throwing an unpaid item and having recoil move + hero out of shop (or to shopkeeper's spot in front of door) would + leave the item unpaid on shop floor and also on the shop's bill but + not visible via 'Iu' or 'Ix'; leaving the shop after that would anger + the shopkeeper and summon kops Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/src/dothrow.c b/src/dothrow.c index 48220a4fb..b3a2f8ba4 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 dothrow.c $NHDT-Date: 1544401268 2018/12/10 00:21:08 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.153 $ */ +/* NetHack 3.6 dothrow.c $NHDT-Date: 1545044705 2018/12/17 11:05:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.154 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -893,21 +893,26 @@ struct obj *obj; xchar x, y; boolean broken; { + boolean costly_xy; struct monst *shkp = shop_keeper(*u.ushops); if (!shkp) return; - if (broken || !costly_spot(x, y) - || *in_rooms(x, y, SHOPBASE) != *u.ushops) { + costly_xy = costly_spot(x, y); + if (broken || !costly_xy || *in_rooms(x, y, SHOPBASE) != *u.ushops) { /* thrown out of a shop or into a different shop */ if (is_unpaid(obj)) (void) stolen_value(obj, u.ux, u.uy, (boolean) shkp->mpeaceful, FALSE); if (broken) obj->no_charge = 1; - } else { - if (costly_spot(u.ux, u.uy) && costly_spot(x, y)) { + } else if (costly_xy) { + char *oshops = in_rooms(x, y, SHOPBASE); + + /* ushops0: in case we threw while levitating and recoiled + out of shop (most likely to the shk's spot in front of door) */ + if (*oshops == *u.ushops || *oshops == *u.ushops0) { if (is_unpaid(obj)) subfrombill(obj, shkp); else if (x != shkp->mx || y != shkp->my)