| 643 | } |
| 644 | |
| 645 | staticfn void |
| 646 | wallify_vault(struct monst *grd) |
| 647 | { |
| 648 | int typ; |
| 649 | coordxy x, y; |
| 650 | int vlt = EGD(grd)->vroom; |
| 651 | char tmp_viz; |
| 652 | coordxy lox = svr.rooms[vlt].lx - 1, hix = svr.rooms[vlt].hx + 1, |
| 653 | loy = svr.rooms[vlt].ly - 1, hiy = svr.rooms[vlt].hy + 1; |
| 654 | struct monst *mon; |
| 655 | struct obj *gold, *rocks; |
| 656 | struct trap *trap; |
| 657 | boolean fixed = FALSE; |
| 658 | boolean movedgold = FALSE; |
| 659 | |
| 660 | for (x = lox; x <= hix; x++) |
| 661 | for (y = loy; y <= hiy; y++) { |
| 662 | /* if not on the room boundary, skip ahead */ |
| 663 | if (x != lox && x != hix && y != loy && y != hiy) |
| 664 | continue; |
| 665 | |
| 666 | if ((!IS_WALL(levl[x][y].typ) || g_at(x, y) |
| 667 | || sobj_at(ROCK, x, y) || sobj_at(BOULDER, x, y)) |
| 668 | && !in_fcorridor(grd, x, y)) { |
| 669 | if ((mon = m_at(x, y)) != 0 && mon != grd) { |
| 670 | if (mon->mtame) |
| 671 | yelp(mon); |
| 672 | if (!rloc(mon, RLOC_MSG)) |
| 673 | m_into_limbo(mon); |
| 674 | } |
| 675 | /* move gold at wall locations into the vault */ |
| 676 | if ((gold = g_at(x, y)) != 0) { |
| 677 | move_gold(gold, EGD(grd)->vroom); |
| 678 | movedgold = TRUE; |
| 679 | } |
| 680 | /* destroy rocks and boulders (subsume them into the walls); |
| 681 | other objects present stay intact and become embedded */ |
| 682 | while ((rocks = sobj_at(ROCK, x, y)) != 0) { |
| 683 | obj_extract_self(rocks); |
| 684 | obfree(rocks, (struct obj *) 0); |
| 685 | } |
| 686 | while ((rocks = sobj_at(BOULDER, x, y)) != 0) { |
| 687 | obj_extract_self(rocks); |
| 688 | obfree(rocks, (struct obj *) 0); |
| 689 | } |
| 690 | if ((trap = t_at(x, y)) != 0) |
| 691 | deltrap(trap); |
| 692 | |
| 693 | if (x == lox) |
| 694 | typ = (y == loy) ? TLCORNER |
| 695 | : (y == hiy) ? BLCORNER |
| 696 | : VWALL; |
| 697 | else if (x == hix) |
| 698 | typ = (y == loy) ? TRCORNER |
| 699 | : (y == hiy) ? BRCORNER |
| 700 | : VWALL; |
| 701 | else /* not left or right side, must be top or bottom */ |
| 702 | typ = HWALL; |
no test coverage detected