Use symbolic name STONE for levl typ 0

This commit is contained in:
Pasi Kallinen
2016-10-07 15:43:27 +03:00
parent f95747e3ef
commit 2c9aac4f13
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -888,7 +888,7 @@ wiz_map_levltyp(VOID_ARGS)
for (x = 1; x < COLNO; x++) { for (x = 1; x < COLNO; x++) {
terrain = levl[x][y].typ; terrain = levl[x][y].typ;
/* assumes there aren't more than 10+26+26 terrain types */ /* 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) : (terrain < 10)
? '0' + terrain ? '0' + terrain
@@ -896,7 +896,7 @@ wiz_map_levltyp(VOID_ARGS)
? 'a' + terrain - 10 ? 'a' + terrain - 10
: 'A' + terrain - 36); : '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++] = '!';
row[x] = '\0'; row[x] = '\0';
putstr(win, 0, row); putstr(win, 0, row);
+1 -1
View File
@@ -231,7 +231,7 @@ int dir;
mz_move(x, y, dir); mz_move(x, y, dir);
mz_move(x, y, dir); mz_move(x, y, dir);
if (x < 3 || y < 3 || x > x_maze_max || y > y_maze_max 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 FALSE;
return TRUE; return TRUE;
} }
+1 -1
View File
@@ -814,7 +814,7 @@ nextpos:
else else
ny += dy; 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 */ /* in view of the above we must have IS_WALL(typ) or typ == POOL */
/* must be a wall here */ /* must be a wall here */
if (isok(nx + nx - x, ny + ny - y) && !IS_POOL(typ) if (isok(nx + nx - x, ny + ny - y) && !IS_POOL(typ)