|| 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 */
(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);
!= 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:
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);
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";