shop object sanity - buried objects
This fixes the reported sanity check warning about a buried object within shop boundary staying flagged no_charge after the shopkeeper leaves the shop. Leaving the shop to pursue the hero moves unpaid items off the bill to owed-as-robbery and changes no_charge items to shop-owned but it wasn't doing the latter for buried objects. I haven't attempted to test on a level with multiple shopkeepers. If that was working correctly for unpaid items than I think it ought to work correctly for no_charge items now. I'm not sure how thoroughly the handling for unpaid items was tested though.
This commit is contained in:
@@ -307,7 +307,9 @@ clear_no_charge_obj(
|
||||
* returns.
|
||||
*/
|
||||
if (!shkp
|
||||
|| (otmp->where != OBJ_FLOOR && otmp->where != OBJ_CONTAINED)
|
||||
|| (otmp->where != OBJ_FLOOR
|
||||
&& otmp->where != OBJ_CONTAINED
|
||||
&& otmp->where != OBJ_BURIED)
|
||||
|| !get_obj_location(otmp, &x, &y, OBJ_CONTAINED | OBJ_BURIED)
|
||||
|| !isok(x, y)
|
||||
|| (rno = levl[x][y].roomno) < ROOMOFFSET
|
||||
@@ -354,6 +356,7 @@ setpaid(register struct monst *shkp)
|
||||
|
||||
/* clear obj->no_charge for all obj in shkp's shop */
|
||||
clear_no_charge(shkp, fobj);
|
||||
clear_no_charge(shkp, gl.level.buriedobjlist);
|
||||
|
||||
while ((obj = gb.billobjs) != 0) {
|
||||
obj_extract_self(obj);
|
||||
|
||||
Reference in New Issue
Block a user