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''.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user