is (x,y) in a town? */
| 3561 | |
| 3562 | /* is (x,y) in a town? */ |
| 3563 | boolean |
| 3564 | in_town(coordxy x, coordxy y) |
| 3565 | { |
| 3566 | struct mkroom *sroom; |
| 3567 | boolean has_subrooms = FALSE; |
| 3568 | |
| 3569 | if (!svl.level.flags.has_town) |
| 3570 | return FALSE; |
| 3571 | |
| 3572 | /* |
| 3573 | * See if (x,y) is in a room with subrooms, if so, assume it's the |
| 3574 | * town. If there are no subrooms, the whole level is in town. |
| 3575 | */ |
| 3576 | for (sroom = &svr.rooms[0]; sroom->hx > 0; sroom++) { |
| 3577 | if (sroom->nsubrooms > 0) { |
| 3578 | has_subrooms = TRUE; |
| 3579 | if (inside_room(sroom, x, y)) |
| 3580 | return TRUE; |
| 3581 | } |
| 3582 | } |
| 3583 | |
| 3584 | return !has_subrooms; |
| 3585 | } |
| 3586 | |
| 3587 | staticfn void |
| 3588 | move_update(boolean newlev) |
no test coverage detected