check whether room contains a particular type of furniture */
| 3479 | |
| 3480 | /* check whether room contains a particular type of furniture */ |
| 3481 | staticfn boolean |
| 3482 | furniture_present(int furniture, int roomno) |
| 3483 | { |
| 3484 | int x, y, lx, ly, hx, hy; |
| 3485 | struct mkroom *sroom = &svr.rooms[roomno]; |
| 3486 | |
| 3487 | ly = sroom->ly, hy = sroom->hy; |
| 3488 | lx = sroom->lx; hx = sroom->hx; |
| 3489 | /* the inside_room() check handles irregularly shaped rooms */ |
| 3490 | for (y = ly; y <= hy; ++y) |
| 3491 | for (x = lx; x <= hx; ++x) |
| 3492 | if (levl[x][y].typ == furniture && inside_room(sroom, x, y)) |
| 3493 | return TRUE; |
| 3494 | return FALSE; |
| 3495 | } |
| 3496 | |
| 3497 | char * |
| 3498 | in_rooms(coordxy x, coordxy y, int typewanted) |
no test coverage detected