This patch fixes shopkeepers ignoring damage to items (and themselves) from exploding land-mines in their shops. Specifically: - Charges player for items destroyed by explosion in the shop - Charges player for items thrown out of the shop - Angers shop keeper when hit/almost hit by an item flying from an explosion eminating from within the shop. This would also work if any other kind of scattering explosions were implimented (but were still always caused by the player, right now there's now need to check because the only way a land mine gets in a shop is you setting there). I hope this fix helps. Let me know what you think! Chris Becker (topher@csh.rit.edu) More bug fixes and patches can be found at http://www.csh.rit.edu/~topher/nethack diff -aur ..\original\nethack-3.4.3\src\explode.c nethack-3.4.3\src\explode.c --- ..\original\nethack-3.4.3\src\explode.c Sun Dec 07 16:39:14 2003 +++ nethack-3.4.3\src\explode.c Sat Jan 03 01:15:40 2004 @@ -419,7 +419,8 @@ struct scatter_chain *stmp, *stmp2 = 0; struct scatter_chain *schain = (struct scatter_chain *)0; long total = 0L; - + char objroom = *in_rooms(sx, sy, SHOPBASE); + while ((otmp = individual_object ? obj : level.objects[sx][sy]) != 0) { if (otmp->quan > 1L) { qtmp = otmp->quan - 1; @@ -460,9 +461,10 @@ } else if ((scflags & MAY_DESTROY) && (!rn2(10) || (objects[otmp->otyp].oc_material == GLASS || otmp->otyp == EGG))) { - if (breaks(otmp, (xchar)sx, (xchar)sy)) used_up = TRUE; + /* pay for things you break - Chris Becker (topher@csh.rit.edu) */ + if (hero_breaks(otmp, (xchar)sx, (xchar)sy, FALSE)) used_up = TRUE; } - + if (!used_up) { stmp = (struct scatter_chain *) alloc(sizeof(struct scatter_chain)); @@ -508,6 +510,15 @@ stmp->obj = (struct obj *)0; stmp->stopped = TRUE; } + /* shk is not happy */ + if (mtmp == shop_keeper(objroom) && mtmp->mpeaceful + && inhishop(mtmp)) { + if (objroom == *u.ushops) { + pline("%s gets angry!", Monnam(mtmp)); + hot_pursuit(mtmp); + (void) angry_guards(FALSE); + } + } } } else if (bhitpos.x==u.ux && bhitpos.y==u.uy) { if (scflags & MAY_HITYOU) { @@ -532,6 +543,18 @@ } stmp->ox = bhitpos.x; stmp->oy = bhitpos.y; + + /* pay for things that got pushed out of the shop */ + if (stmp->stopped && stmp->obj && !stmp->obj->no_charge + && costly_spot(sx, sy) + && (!costly_spot(stmp->ox,stmp->oy) || + *in_rooms(stmp->ox, stmp->oy, SHOPBASE) != *u.ushops) ) { + mtmp = shop_keeper(objroom); + if (mtmp && inhishop(mtmp)) { + (void)stolen_value(stmp->obj, sx, sy, + (boolean)mtmp->mpeaceful, FALSE); + } + } } } }