static void FDECL(dig_up_grave, (coord *));
static int FDECL(adj_pit_checks, (coord *, char *));
static void FDECL(pit_flow, (struct trap *, SCHAR_P));
+static boolean FDECL(furniture_handled, (int, int, BOOLEAN_P));
/* Indices returned by dig_typ() */
enum dig_types {
return 1;
}
+static boolean
+furniture_handled(x, y, madeby_u)
+int x, y;
+boolean madeby_u;
+{
+ struct rm *lev = &levl[x][y];
+
+ if (IS_FOUNTAIN(lev->typ)) {
+ dogushforth(FALSE);
+ SET_FOUNTAIN_WARNED(x, y); /* force dryup */
+ dryup(x, y, madeby_u);
+ } else if (IS_SINK(lev->typ)) {
+ breaksink(x, y);
+ } else if (lev->typ == DRAWBRIDGE_DOWN
+ || (is_drawbridge_wall(x, y) >= 0)) {
+ int bx = x, by = y;
+
+ /* if under the portcullis, the bridge is adjacent */
+ (void) find_drawbridge(&bx, &by);
+ destroy_drawbridge(bx, by);
+ } else {
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
/* When will hole be finished? Very rough indication used by shopkeeper. */
int
holetime()
reset_utrap(FALSE);
}
- /* these furniture checks were in dighole(), but wand
- breaking bypasses that routine and calls us directly */
- if (IS_FOUNTAIN(lev->typ)) {
- dogushforth(FALSE);
- SET_FOUNTAIN_WARNED(x, y); /* force dryup */
- dryup(x, y, madeby_u);
- return;
- } else if (IS_SINK(lev->typ)) {
- breaksink(x, y);
+ if (furniture_handled(x, y, madeby_u))
return;
- } else if (lev->typ == DRAWBRIDGE_DOWN
- || (is_drawbridge_wall(x, y) >= 0)) {
- int bx = x, by = y;
-
- /* if under the portcullis, the bridge is adjacent */
- (void) find_drawbridge(&bx, &by);
- destroy_drawbridge(bx, by);
- return;
- }
if (ttyp != PIT && (!Can_dig_down(&u.uz) && !lev->candig)) {
impossible("digactualhole: can't dig %s on this level.",
lev->flags = 0;
if (typ != ROOM) {
- lev->typ = typ;
- liquid_flow(dig_x, dig_y, typ, ttmp,
- "As you dig, the hole fills with %s!");
+ if (!furniture_handled((int) dig_x, (int) dig_y, TRUE)) {
+ lev->typ = typ;
+ liquid_flow(dig_x, dig_y, typ, ttmp,
+ "As you dig, the hole fills with %s!");
+ }
return TRUE;
}