is x,y a good location for a door into room? */
| 70 | |
| 71 | /* is x,y a good location for a door into room? */ |
| 72 | staticfn boolean |
| 73 | good_rm_wall_doorpos(coordxy x, coordxy y, int dir, struct mkroom *room) |
| 74 | { |
| 75 | coordxy tx, ty; |
| 76 | int rmno; |
| 77 | |
| 78 | if (!isok(x, y) || !room->needjoining) |
| 79 | return FALSE; |
| 80 | |
| 81 | if (!(levl[x][y].typ == HWALL |
| 82 | || levl[x][y].typ == VWALL |
| 83 | || IS_DOOR(levl[x][y].typ) |
| 84 | || levl[x][y].typ == SDOOR)) |
| 85 | return FALSE; |
| 86 | |
| 87 | if (bydoor(x, y)) |
| 88 | return FALSE; |
| 89 | |
| 90 | tx = x + xdir[dir]; |
| 91 | ty = y + ydir[dir]; |
| 92 | |
| 93 | if (!isok(tx,ty) || IS_OBSTRUCTED(levl[tx][ty].typ)) |
| 94 | return FALSE; |
| 95 | |
| 96 | rmno = (room - svr.rooms) + ROOMOFFSET; |
| 97 | |
| 98 | if (rmno != (int) levl[tx][ty].roomno) |
| 99 | return FALSE; |
| 100 | |
| 101 | return TRUE; |
| 102 | } |
| 103 | |
| 104 | /* starting from x,y going towards dir, find a good location for a door */ |
| 105 | staticfn boolean |
no test coverage detected