mkmaze() tweak
This shouldn't have any effect on behavior, just make mazexy() be a little easier to comprehend.
This commit is contained in:
+6
-7
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 mkmaze.c $NHDT-Date: 1627951223 2021/08/03 00:40:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.122 $ */
|
/* NetHack 3.7 mkmaze.c $NHDT-Date: 1648064596 2022/03/23 19:43:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.133 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Pasi Kallinen, 2018. */
|
/*-Copyright (c) Pasi Kallinen, 2018. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -1218,10 +1218,10 @@ mazexy(coord *cc)
|
|||||||
do {
|
do {
|
||||||
cc->x = 1 + rn2(g.x_maze_max);
|
cc->x = 1 + rn2(g.x_maze_max);
|
||||||
cc->y = 1 + rn2(g.y_maze_max);
|
cc->y = 1 + rn2(g.y_maze_max);
|
||||||
cpt++;
|
if (levl[cc->x][cc->y].typ == (g.level.flags.corrmaze ? CORR : ROOM))
|
||||||
} while (cpt < 100
|
return;
|
||||||
&& levl[cc->x][cc->y].typ
|
} while (++cpt < 100);
|
||||||
!= (g.level.flags.corrmaze ? CORR : ROOM));
|
|
||||||
if (cpt >= 100) {
|
if (cpt >= 100) {
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
@@ -1230,8 +1230,7 @@ mazexy(coord *cc)
|
|||||||
for (y = 1; y < g.y_maze_max; y++) {
|
for (y = 1; y < g.y_maze_max; y++) {
|
||||||
cc->x = x;
|
cc->x = x;
|
||||||
cc->y = y;
|
cc->y = y;
|
||||||
if (levl[cc->x][cc->y].typ
|
if (levl[x][y].typ == (g.level.flags.corrmaze ? CORR : ROOM))
|
||||||
== (g.level.flags.corrmaze ? CORR : ROOM))
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
panic("mazexy: can't find a place!");
|
panic("mazexy: can't find a place!");
|
||||||
|
|||||||
Reference in New Issue
Block a user