]> granicus.if.org Git - nethack/commitdiff
R1049 followup
authorcohrs <cohrs>
Wed, 21 Aug 2002 23:36:47 +0000 (23:36 +0000)
committercohrs <cohrs>
Wed, 21 Aug 2002 23:36:47 +0000 (23:36 +0000)
This patch handles the case of angering the town watch when breaking a wand
of digging damages walls or doors.

src/apply.c

index 6e1e645dcb5ec2b210732e6cbbfeff49cc7d74cd..39c8ce5b694243f82e39e91b768ba6f375eb3714 100644 (file)
@@ -2645,8 +2645,12 @@ do_break_wand(obj)
 
        if (obj->otyp == WAN_DIGGING) {
            if(dig_check(BY_OBJECT, FALSE, x, y)) {
-               if ((IS_WALL(levl[x][y].typ) || IS_DOOR(levl[x][y].typ)) &&
-                   *in_rooms(x,y,SHOPBASE)) shop_damage = TRUE;
+               if (IS_WALL(levl[x][y].typ) || IS_DOOR(levl[x][y].typ)) {
+                   /* normally, pits and holes don't anger guards, but they
+                    * do if it's a wall or door that's being dug */
+                   watch_dig((struct monst *)0, x, y, TRUE);
+                   if (*in_rooms(x,y,SHOPBASE)) shop_damage = TRUE;
+               }                   
                digactualhole(x, y, BY_OBJECT,
                              (rn2(obj->spe) < 3 || !Can_dig_down(&u.uz)) ?
                               PIT : HOLE);