From: copperwater Date: Sat, 28 May 2022 14:42:14 +0000 (-0400) Subject: Remove unused "mazeflag" parameter from mkfount() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a1258f898ba8567e77b3ad3ba5ecb04d641d4295;p=nethack Remove unused "mazeflag" parameter from mkfount() This parameter appears to have been in the code for a very long time, but never used, since no version of NetHack I can find had mazes with randomly placed fountains in them. Certainly isn't used now, so this can be reduced to the same call to find_okay_roompos used by similar functions such as mksink. --- diff --git a/src/mklev.c b/src/mklev.c index c49479def..f3eb47b0f 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -12,7 +12,7 @@ static boolean generate_stairs_room_good(struct mkroom *, int); static struct mkroom *generate_stairs_find_room(void); static void generate_stairs(void); -static void mkfount(int, struct mkroom *); +static void mkfount(struct mkroom *); static boolean find_okay_roompos(struct mkroom *, coord *); static void mksink(struct mkroom *); static void mkaltar(struct mkroom *); @@ -789,7 +789,7 @@ fill_ordinary_room(struct mkroom *croom) if (Is_rogue_level(&u.uz)) goto skip_nonrogue; if (!rn2(10)) - mkfount(0, croom); + mkfount(croom); if (!rn2(60)) mksink(croom); if (!rn2(60)) @@ -1752,19 +1752,12 @@ generate_stairs(void) } static void -mkfount(int mazeflag, struct mkroom *croom) +mkfount(struct mkroom *croom) { coord m; - register int tryct = 0; - do { - if (++tryct > 200) - return; - if (mazeflag) - mazexy(&m); - else if (!somexy(croom, &m)) - return; - } while (occupied(m.x, m.y) || bydoor(m.x, m.y)); + if (!find_okay_roompos(croom, &m)) + return; /* Put a fountain at m.x, m.y */ if (!set_levltyp(m.x, m.y, FOUNTAIN))