* Select a random coordinate in the maze. * * We want a place not 'touched' by the loader. That is, a place in * the maze outside every part of the special level. */
| 2897 | * the maze outside every part of the special level. |
| 2898 | */ |
| 2899 | staticfn void |
| 2900 | maze1xy(coord *m, int humidity) |
| 2901 | { |
| 2902 | int x, y, tryct = 2000; |
| 2903 | /* tryct: normally it won't take more than ten or so tries due |
| 2904 | to the circumstances under which we'll be called, but the |
| 2905 | `humidity' screening might drastically change the chances */ |
| 2906 | |
| 2907 | do { |
| 2908 | x = rn1(gx.x_maze_max - 3, 3); |
| 2909 | y = rn1(gy.y_maze_max - 3, 3); |
| 2910 | if (--tryct < 0) |
| 2911 | break; /* give up */ |
| 2912 | } while (!(x % 2) || !(y % 2) || SpLev_Map[x][y] |
| 2913 | || !is_ok_location((coordxy) x, (coordxy) y, humidity)); |
| 2914 | |
| 2915 | m->x = (coordxy) x, m->y = (coordxy) y; |
| 2916 | } |
| 2917 | |
| 2918 | /* |
| 2919 | * If there's a significant portion of maze unused by the special level, |
no test coverage detected