is x,y right next to room droom? */
| 1086 | |
| 1087 | /* is x,y right next to room droom? */ |
| 1088 | staticfn boolean |
| 1089 | shared_with_room(int x, int y, struct mkroom *droom) |
| 1090 | { |
| 1091 | int rmno = (droom - svr.rooms) + ROOMOFFSET; |
| 1092 | |
| 1093 | if (!isok(x,y)) |
| 1094 | return FALSE; |
| 1095 | if ((int) levl[x][y].roomno == rmno && !levl[x][y].edge) |
| 1096 | return FALSE; |
| 1097 | if (isok(x-1, y) && (int) levl[x-1][y].roomno == rmno && x-1 <= droom->hx) |
| 1098 | return TRUE; |
| 1099 | if (isok(x+1, y) && (int) levl[x+1][y].roomno == rmno && x+1 >= droom->lx) |
| 1100 | return TRUE; |
| 1101 | if (isok(x, y-1) && (int) levl[x][y-1].roomno == rmno && y-1 <= droom->hy) |
| 1102 | return TRUE; |
| 1103 | if (isok(x, y+1) && (int) levl[x][y+1].roomno == rmno && y+1 >= droom->ly) |
| 1104 | return TRUE; |
| 1105 | return FALSE; |
| 1106 | } |
| 1107 | |
| 1108 | /* maybe add door at x,y to room droom */ |
| 1109 | staticfn void |
no test coverage detected