* Get a relative position inside a room. * negative values for x or y means RANDOM! */
| 1357 | * negative values for x or y means RANDOM! |
| 1358 | */ |
| 1359 | staticfn void |
| 1360 | get_room_loc(coordxy *x, coordxy *y, struct mkroom *croom) |
| 1361 | { |
| 1362 | coord c; |
| 1363 | |
| 1364 | if (*x < 0 && *y < 0) { |
| 1365 | if (somexy(croom, &c)) { |
| 1366 | *x = c.x; |
| 1367 | *y = c.y; |
| 1368 | } else |
| 1369 | panic("get_room_loc : can't find a place!"); |
| 1370 | } else { |
| 1371 | if (*x < 0) |
| 1372 | *x = rn2(croom->hx - croom->lx + 1); |
| 1373 | if (*y < 0) |
| 1374 | *y = rn2(croom->hy - croom->ly + 1); |
| 1375 | *x += croom->lx; |
| 1376 | *y += croom->ly; |
| 1377 | } |
| 1378 | } |
| 1379 | |
| 1380 | /* |
| 1381 | * Get a relative position inside a room. |
no test coverage detected