diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 68cb906c3..639904882 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -738,6 +738,13 @@ getting wounded in one leg when the other was already wounded miraculously when parsing config file entry "BINDINGS=key1:cmd1,key2:cmd2,key3:cmd3" allow keyN to be either a naked comma or backslash+comma instead requiring that comma's numeric value be used to bind comma to a command +when two or more shops share a wall and hero uses Passes_walls to carry an + unpaid item from inside a shop into the shared wall, it could yield + impossible "unpaid_cost: object wasn't on any bill" when examining + inventory if the shop code picked wrong shopkeeper to determine cost +when two or more shops share a wall and hero uses Passes_walls to carry an + unpaid item through the shared wall into another shop, theft of that + unpaid item from the first shop wasn't noticed Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/shk.c b/src/shk.c index edcee5cea..06501cba5 100644 --- a/src/shk.c +++ b/src/shk.c @@ -385,7 +385,7 @@ inside_shop(register xchar x, register xchar y) } void -u_left_shop(char* leavestring, boolean newlev) +u_left_shop(char *leavestring, boolean newlev) { struct monst *shkp; struct eshk *eshkp; @@ -400,7 +400,7 @@ u_left_shop(char* leavestring, boolean newlev) if (!*leavestring && (!levl[u.ux][u.uy].edge || levl[u.ux0][u.uy0].edge)) return; - shkp = shop_keeper(*u.ushops0); + shkp = shop_keeper(*leavestring ? *leavestring : *u.ushops0); if (!shkp || !inhishop(shkp)) return; /* shk died, teleported, changed levels... */ @@ -2422,19 +2422,20 @@ unpaid_cost( struct bill_x *bp = (struct bill_x *) 0; struct monst *shkp; long amt = 0L; + +#if 0 /* if two shops share a wall, this might find wrong shk */ xchar ox, oy; if (!get_obj_location(unp_obj, &ox, &oy, BURIED_TOO | CONTAINED_TOO)) ox = u.ux, oy = u.uy; /* (shouldn't happen) */ if ((shkp = shop_keeper(*in_rooms(ox, oy, SHOPBASE))) != 0) { bp = onbill(unp_obj, shkp, TRUE); - } else { - /* didn't find shk? try searching bills */ - for (shkp = next_shkp(fmon, TRUE); shkp; - shkp = next_shkp(shkp->nmon, TRUE)) - if ((bp = onbill(unp_obj, shkp, TRUE)) != 0) - break; - } + } else /* didn't find shk? try searching bills */ +#endif + for (shkp = next_shkp(fmon, TRUE); shkp; + shkp = next_shkp(shkp->nmon, TRUE)) + if ((bp = onbill(unp_obj, shkp, TRUE)) != 0) + break; /* onbill() gave no message if unexpected problem occurred */ if (!shkp || (unp_obj->unpaid && !bp)) {