From 8c744de8cdb461f93a3252e3e18a679d3ffc965b Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 19 Apr 2020 03:20:01 -0700 Subject: [PATCH] || vs && Add some parentheses. --- src/mklev.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mklev.c b/src/mklev.c index be812e1aa..9641ce6d9 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 mklev.c $NHDT-Date: 1562455089 2019/07/06 23:18:09 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.63 $ */ +/* NetHack 3.6 mklev.c $NHDT-Date: 1587291592 2020/04/19 10:19:52 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.85 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Alex Smith, 2017. */ /* NetHack may be freely redistributed. See license for details. */ @@ -279,10 +279,13 @@ makerooms() if (dothemes) { g.in_mk_themerooms = TRUE; g.themeroom_failed = FALSE; - lua_getglobal(g.dungeons[u.uz.dnum].themelua, "themerooms_generate"); + lua_getglobal(g.dungeons[u.uz.dnum].themelua, + "themerooms_generate"); lua_call(g.dungeons[u.uz.dnum].themelua, 0, 0); g.in_mk_themerooms = FALSE; - if (g.themeroom_failed && ((themeroom_tries++ > 10) || (g.nroom >= (MAXNROFROOMS / 6)))) + if (g.themeroom_failed + && ((themeroom_tries++ > 10) + || (g.nroom >= (MAXNROFROOMS / 6)))) break; } else { if (!create_room(-1, -1, -1, -1, -1, -1, OROOM, -1)) @@ -361,8 +364,8 @@ boolean nxcor; dest.x = tx; dest.y = ty; - if (!dig_corridor(&org, &dest, nxcor, g.level.flags.arboreal ? ROOM : CORR, - STONE)) + if (!dig_corridor(&org, &dest, nxcor, + g.level.flags.arboreal ? ROOM : CORR, STONE)) return; /* we succeeded in digging the corridor */ @@ -718,7 +721,7 @@ clear_level_structures() static void makelevel() { - register struct mkroom *croom, *troom; + register struct mkroom *croom; register int tryct; register int x, y; struct monst *tmonst; /* always put a web with a spider */ @@ -1169,7 +1172,8 @@ coord *mp; do croom = &g.rooms[rn2(g.nroom)]; while ((croom == g.dnstairs_room || croom == g.upstairs_room - || (croom->rtype != OROOM && croom->rtype != THEMEROOM)) && (++tryct < 100)); + || (croom->rtype != OROOM && croom->rtype != THEMEROOM)) + && (++tryct < 100)); } else croom = &g.rooms[rn2(g.nroom)]; @@ -1296,10 +1300,10 @@ xchar x, y; boolean near_door = bydoor(x, y); return ((levl[x][y].typ == HWALL || levl[x][y].typ == VWALL) - && (isok(x-1,y) && !IS_ROCK(levl[x-1][y].typ) - || isok(x+1,y) && !IS_ROCK(levl[x+1][y].typ) - || isok(x,y-1) && !IS_ROCK(levl[x][y-1].typ) - || isok(x,y+1) && !IS_ROCK(levl[x][y+1].typ)) + && ((isok(x - 1, y) && !IS_ROCK(levl[x - 1][y].typ)) + || (isok(x + 1, y) && !IS_ROCK(levl[x + 1][y].typ)) + || (isok(x, y - 1) && !IS_ROCK(levl[x][y - 1].typ)) + || (isok(x, y + 1) && !IS_ROCK(levl[x][y + 1].typ))) && g.doorindex < DOORMAX && !near_door); }