diff --git a/src/hack.c b/src/hack.c index 497ee3582..636ee7ab3 100644 --- a/src/hack.c +++ b/src/hack.c @@ -243,7 +243,7 @@ moverock(void) || doorless_door(rx, ry)) && !sobj_at(BOULDER, rx, ry)) { ttmp = t_at(rx, ry); mtmp = m_at(rx, ry); - costly = (!otmp->no_charge && costly_spot(sx, sy) + costly = (costly_spot(sx, sy) && shop_keeper(*in_rooms(sx, sy, SHOPBASE))); /* KMH -- Sokoban doesn't let you push boulders diagonally */ @@ -383,7 +383,7 @@ moverock(void) (void) rloco(otmp); } else { if (costly) - addtobill(otmp, FALSE, FALSE, FALSE); + stolen_value(otmp, rx, ry, !ttmp->tseen, FALSE); obj_extract_self(otmp); add_to_migration(otmp); get_level(&dest, newlev); @@ -451,6 +451,12 @@ moverock(void) != 0) && onshopbill(otmp, shkp, TRUE)) { subfrombill(otmp, shkp); + } else if (otmp->unpaid && !*in_rooms(rx, ry, SHOPBASE) + && *in_rooms(sx, sy, SHOPBASE)) { + /* once the boulder is fully out of the shop, so that it's + * impossible to change your mind and push it back in without + * leaving and triggering Kops, switch it to stolen_value */ + stolen_value(otmp, sx, sy, TRUE, FALSE); } } else { nopushmsg: diff --git a/src/mkobj.c b/src/mkobj.c index 8461369ef..38b967525 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -2463,6 +2463,11 @@ add_to_migration(struct obj *obj) if (obj->where != OBJ_FREE) panic("add_to_migration: obj not free"); + if (obj->unpaid) /* caller should have changed unpaid item to stolen */ + impossible("unpaid object migrating to another level? [%s]", + simpleonames(obj)); + obj->no_charge = 0; /* was only relevant while inside a shop */ + /* lock picking context becomes stale if it's for this object */ if (Is_container(obj)) maybe_reset_pick(obj); @@ -2830,7 +2835,7 @@ shop_obj_sanity(struct obj *obj, const char *mesg) and for objects inside floor containers in shops */ if (otop->where != OBJ_FLOOR) why = "%s no_charge obj not on floor! %s %s: %s"; - else if (!costly) + else if (!costly && !costlytoo) why = "%s no_charge obj not inside tended shop! %s %s: %s"; else if (!shkp) why = "%s no_charge obj inside untended shop! %s %s: %s";