From bbda8102b5a027c1ba0a20d06a0eda40cf1f17c9 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 31 Oct 2006 07:12:56 +0000 Subject: [PATCH] shop fixes [I accidentally left this out of the previous commit.] Throwing didn't handle a container owned by the hero which contained items owned by the shopkeeper. I'm still not quite sure what's going on there, but throwing the container out of the shop didn't give any feedback but did add to shop charges which don't show up in ``I x'' (but do get revealed by ``$'' or ``I $''). Now there's some shop feedback for the throw and the contents show up for ``I x''. --- src/dothrow.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/dothrow.c b/src/dothrow.c index 6ec093f98..5d61f0356 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -691,30 +691,24 @@ mhurtle(mon, dx, dy, range) STATIC_OVL void check_shop_obj(obj, x, y, broken) -register struct obj *obj; -register xchar x, y; -register boolean broken; +struct obj *obj; +xchar x, y; +boolean broken; { struct monst *shkp = shop_keeper(*u.ushops); if(!shkp) return; - if(broken) { - if (obj->unpaid) - (void)stolen_value(obj, u.ux, u.uy, - (boolean)shkp->mpeaceful, FALSE); - obj->no_charge = 1; - return; - } - - if (!costly_spot(x, y) || *in_rooms(x, y, SHOPBASE) != *u.ushops) { + if (broken || + !costly_spot(x, y) || *in_rooms(x, y, SHOPBASE) != *u.ushops) { /* thrown out of a shop or into a different shop */ - if (obj->unpaid) + if (count_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)) { - if (obj->unpaid) + if (count_unpaid(obj)) subfrombill(obj, shkp); else if (x != shkp->mx || y != shkp->my) sellobj(obj, x, y);