]> granicus.if.org Git - nethack/commitdiff
Use symbolic name STONE for levl typ 0
authorPasi Kallinen <paxed@alt.org>
Fri, 7 Oct 2016 12:43:27 +0000 (15:43 +0300)
committerPasi Kallinen <paxed@alt.org>
Fri, 7 Oct 2016 12:43:27 +0000 (15:43 +0300)
src/cmd.c
src/mkmaze.c
src/vault.c

index 3735b95d04266bdd4fa4e6d589fcc614e07bc60a..4f6a17a49f954f5892db1e8737eb42b9938502d7 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -888,7 +888,7 @@ wiz_map_levltyp(VOID_ARGS)
         for (x = 1; x < COLNO; x++) {
             terrain = levl[x][y].typ;
             /* assumes there aren't more than 10+26+26 terrain types */
-            row[x - 1] = (char) ((terrain == 0 && !may_dig(x, y))
+            row[x - 1] = (char) ((terrain == STONE && !may_dig(x, y))
                                     ? '*'
                                     : (terrain < 10)
                                        ? '0' + terrain
@@ -896,7 +896,7 @@ wiz_map_levltyp(VOID_ARGS)
                                           ? 'a' + terrain - 10
                                           : 'A' + terrain - 36);
         }
-        if (levl[0][y].typ != 0 || may_dig(0, y))
+        if (levl[0][y].typ != STONE || may_dig(0, y))
             row[x++] = '!';
         row[x] = '\0';
         putstr(win, 0, row);
index 8497f1c7e75ab30b72095a8e5dfed837a595316c..9d4124d2c7112b1392e569e6199618dbd4d274be 100644 (file)
@@ -231,7 +231,7 @@ int dir;
     mz_move(x, y, dir);
     mz_move(x, y, dir);
     if (x < 3 || y < 3 || x > x_maze_max || y > y_maze_max
-        || levl[x][y].typ != 0)
+        || levl[x][y].typ != STONE)
         return FALSE;
     return TRUE;
 }
index 143f390dc0b1b77ed474b63e79df5b4c5caae415..909cc3872fcf33cd375e07c3e1d10d2df9feb62e 100644 (file)
@@ -814,7 +814,7 @@ nextpos:
     else
         ny += dy;
 
-    while ((typ = (crm = &levl[nx][ny])->typ) != 0) {
+    while ((typ = (crm = &levl[nx][ny])->typ) != STONE) {
         /* in view of the above we must have IS_WALL(typ) or typ == POOL */
         /* must be a wall here */
         if (isok(nx + nx - x, ny + ny - y) && !IS_POOL(typ)