Fix shopkeeper getting mad when monster triggers a trap
When a monster triggered a rolling boulder trap which buried a shop item in a pit, the shopkeeper would bill the hero. (Or get mad at hero, if they were out of the shop) The fix might not be quite right - should the shopkeeper get mad at hero when monster triggers a trap created by hero? Or when an item is buried in a pit created by a hero?
This commit is contained in:
@@ -1920,7 +1920,7 @@ bury_objs(int x, int y)
|
||||
debugpline2("bury_objs: at <%d,%d>", x, y);
|
||||
}
|
||||
for (otmp = gl.level.objects[x][y]; otmp; otmp = otmp2) {
|
||||
if (costly) {
|
||||
if (costly && !gc.context.mon_moving) {
|
||||
loss += stolen_value(otmp, x, y, (boolean) shkp->mpeaceful, TRUE);
|
||||
if (otmp->oclass != COIN_CLASS)
|
||||
otmp->no_charge = 1;
|
||||
|
||||
@@ -4756,7 +4756,7 @@ useupf(struct obj *obj, long numused)
|
||||
otmp = splitobj(obj, numused);
|
||||
else
|
||||
otmp = obj;
|
||||
if (costly_spot(otmp->ox, otmp->oy)) {
|
||||
if (!gc.context.mon_moving && costly_spot(otmp->ox, otmp->oy)) {
|
||||
if (strchr(u.urooms, *in_rooms(otmp->ox, otmp->oy, 0)))
|
||||
addtobill(otmp, FALSE, FALSE, FALSE);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user