56 if (mode < 1 || mode > 4) {
67 for (i = 1; i < RP->
Xsize; i++)
68 for (j = 1; j < RP->
Ysize; j++) {
69 if (
layout[i][j] == target) {
79 for (i = RP->
Xsize-2; i > 0; i--)
80 for (j = 1; j < RP->
Ysize-1; j++) {
81 if (
layout[i][j] == target) {
91 for (i = 1; i < RP->
Xsize-1; i++)
92 for (j = RP->
Ysize-2; j > 0; j--) {
93 if (
layout[i][j] == target) {
103 for (i = RP->
Xsize-2; i > 0; i--)
104 for (j = RP->
Ysize-2; j > 0; j--) {
105 if (
layout[i][j] == target) {
146 char styledirname[256];
149 object *the_exit_down;
153 int cx = -1, cy = -1;
154 int upx = -1, upy = -1;
155 int downx = -1, downy = -1;
156 int final_map_exit = 1;
163 if (orientation == 0) {
164 orientation =
RANDOM()%6+1;
167 switch (orientation) {
169 snprintf(styledirname,
sizeof(styledirname),
"/styles/exitstyles/up");
170 style_map_up =
find_style(styledirname, exitstyle, -1);
171 snprintf(styledirname,
sizeof(styledirname),
"/styles/exitstyles/down");
172 style_map_down =
find_style(styledirname, exitstyle, -1);
177 snprintf(styledirname,
sizeof(styledirname),
"/styles/exitstyles/down");
178 style_map_up =
find_style(styledirname, exitstyle, -1);
179 snprintf(styledirname,
sizeof(styledirname),
"/styles/exitstyles/up");
180 style_map_down =
find_style(styledirname, exitstyle, -1);
185 snprintf(styledirname,
sizeof(styledirname),
"/styles/exitstyles/generic");
186 style_map_up =
find_style(styledirname, exitstyle, -1);
187 style_map_down = style_map_up;
192 if (style_map_up == NULL) {
194 if (exit_arch == NULL) {
213 }
else if (style_map_down == NULL) {
226 the_exit_down = NULL;
242 if (upx == -1 && cx != -1) {
243 if (cx > RP->
Xsize/2) {
248 if (cy > RP->
Ysize/2) {
255 if (upx == 1 && upy == 1) {
257 }
else if (upx == 1 && upy > 1) {
259 }
else if (upx > 1 && upy == 1) {
261 }
else if (upx > 1 && upy > 1) {
272 for (j = 1; j < 9; j++) {
285 maze[upx][upy] =
'<';
302 if (upx > RP->
Xsize/2) {
307 if (upy > RP->
Ysize/2) {
314 if (downx == 1 && downy == 1) {
316 }
else if (downx == 1 && downy > 1) {
318 }
else if (downx > 1 && downy == 1) {
320 }
else if (downx > 1 && downy > 1) {
366 if (final_map_exit == 1) {
386 maze[the_exit_down->
x][the_exit_down->
y] =
'>';
405 for (i = 0; i < RP->
Xsize; i++)
406 for (j = 0; j < RP->
Ysize; j++)
407 if (maze[i][j] ==
'>' || maze[i][j] ==
'<') {